﻿(function(a, r, s) {
    var k = {
        mix: function(h, d, t, w) {
            if (!d || !h) return h;
            if (t === s) t = true;
            var m, q, v;
            if (w && (v = w.length)) for (m = 0; m < v; m++) {
                q = w[m];
                if (q in d) if (t || !(q in h)) h[q] = d[q]
            } else for (q in d) if (t || !(q in h)) h[q] = d[q];
            return h
        }
    },
    g = a && a[r] || {},
    l = 0;
    a = g.__HOST || (g.__HOST = a || {});
    r = a[r] = k.mix(g, k, false);
    r.mix(r, {
        __APP_MEMBERS: ["namespace"],
        __APP_INIT_METHODS: ["__init"],
        version: "1.1.6",
        merge: function() {
            var h = {},
            d, t = arguments.length;
            for (d = 0; d < t; d++) r.mix(h, arguments[d]);
            return h
        },
        augment: function() {
            var h = arguments,
            d = h.length - 2,
            t = h[0],
            w = h[d],
            m = h[d + 1],
            q = 1;
            if (!r.isArray(m)) {
                w = m;
                m = s;
                d++
            }
            if (!r.isBoolean(w)) {
                w = s;
                d++
            }
            for (; q < d; q++) r.mix(t.prototype, h[q].prototype || h[q], w, m);
            return t
        },
        extend: function(h, d, t, w) {
            if (!d || !h) return h;
            var m = Object.create ?
            function(i, o) {
                return Object.create(i, {
                    constructor: {
                        value: o
                    }
                })
            }: function(i, o) {
                function e() {}
                e.prototype = i;
                var c = new e;
                c.constructor = o;
                return c
            },
            q = d.prototype,
            v;
            h.prototype = v = m(q, h);
            h.superclass = m(q, d);
            t && r.mix(v, t);
            w && r.mix(h, w);
            return h
        },
        __init: function() {
            this.Config = this.Config || {};
            this.Env = this.Env || {};
            this.Config.debug = ""
        },
        namespace: function() {
            var h = arguments,
            d = h.length,
            t = null,
            w, m, q, v = h[d - 1] === true && d--;
            for (w = 0; w < d; w++) {
                q = ("" + h[w]).split(".");
                t = v ? a: this;
                for (m = a[q[0]] === t ? 1 : 0; m < q.length; ++m) t = t[q[m]] = t[q[m]] || {}
            }
            return t
        },
        app: function(h, d) {
            var t = r.isString(h),
            w = t ? a[h] || {}: h,
            m = 0,
            q = r.__APP_INIT_METHODS.length;
            for (r.mix(w, this, true, r.__APP_MEMBERS); m < q; m++) r[r.__APP_INIT_METHODS[m]].call(w);
            r.mix(w, r.isFunction(d) ? d() : d);
            t && (a[h] = w);
            return w
        },
        log: function(h, d, t) {
            if (r.Config.debug) {
                if (t) h = t + ": " + h;
                if (a.console !== s && console.log) console[d && console[d] ? d: "log"](h)
            }
        },
        error: function(h) {
            if (r.Config.debug) throw h;
        },
        guid: function(h) {
            return (h || "") + l++
        }
    });
    r.__init();
    return r
})(this, "KISSY"); (function(a, r) {
    var s = a.__HOST,
    k = Object.prototype.toString,
    g = Array.prototype.indexOf,
    l = Array.prototype.lastIndexOf,
    h = Array.prototype.filter,
    d = String.prototype.trim,
    t = /^\s+|\s+$/g,
    w = {};
    a.mix(a, {
        type: function(m) {
            return m == null ? String(m) : w[k.call(m)] || "object"
        },
        isNull: function(m) {
            return m === null
        },
        isUndefined: function(m) {
            return m === r
        },
        isEmptyObject: function(m) {
            for (var q in m) return false;
            return true
        },
        isPlainObject: function(m) {
            return m && k.call(m) === "[object Object]" && "isPrototypeOf" in m
        },
        clone: function(m) {
            var q = m,
            v, i;
            if (m && ((v = a.isArray(m)) || a.isPlainObject(m))) {
                q = v ? [] : {};
                for (i in m) if (m.hasOwnProperty(i)) q[i] = a.clone(m[i])
            }
            return q
        },
        trim: d ?
        function(m) {
            return m == r ? "": d.call(m)
        }: function(m) {
            return m == r ? "": m.toString().replace(t, "")
        },
        substitute: function(m, q, v) {
            if (!a.isString(m) || !a.isPlainObject(q)) return m;
            return m.replace(v || /\\?\{([^{}]+)\}/g,
            function(i, o) {
                if (i.charAt(0) === "\\") return i.slice(1);
                return q[o] !== r ? q[o] : ""
            })
        },
        each: function(m, q, v) {
            var i, o = 0,
            e = m ? m.length: r,
            c = e === r || a.type(m) === "function";
            v = v || s;
            if (c) for (i in m) {
                if (q.call(v, m[i], i, m) === false) break
            } else for (i = m[0]; o < e && q.call(v, i, o, m) !== false; i = m[++o]);
            return m
        },
        indexOf: g ?
        function(m, q) {
            return g.call(q, m)
        }: function(m, q) {
            for (var v = 0,
            i = q.length; v < i; ++v) if (q[v] === m) return v;
            return - 1
        },
        lastIndexOf: l ?
        function(m, q) {
            return l.call(q, m)
        }: function(m, q) {
            for (var v = q.length - 1; v >= 0; v--) if (q[v] === m) break;
            return v
        },
        unique: function(m, q) {
            q && m.reverse();
            for (var v = m.slice(), i = 0, o, e; i < v.length;) {
                for (e = v[i]; (o = a.lastIndexOf(e, v)) !== i;) v.splice(o, 1);
                i += 1
            }
            q && v.reverse();
            return v
        },
        inArray: function(m, q) {
            return a.indexOf(m, q) > -1
        },
        filter: h ?
        function(m, q, v) {
            return h.call(m, q, v)
        }: function(m, q, v) {
            var i = [];
            a.each(m,
            function(o, e, c) {
                q.call(v, o, e, c) && i.push(o)
            });
            return i
        },
        now: function() {
            return (new Date).getTime()
        }
    });
    a.each("Boolean Number String Function Array Date RegExp Object".split(" "),
    function(m, q) {
        w["[object " + m + "]"] = q = m.toLowerCase();
        a["is" + m] = function(v) {
            return a.type(v) == q
        }
    })
})(KISSY); (function(a, r) {
    function s(e) {
        var c = typeof e;
        return e === null || c !== "object" && c !== "function"
    }
    function k(e) {
        return Array.prototype.slice.call(e)
    }
    var g = a.__HOST,
    l = g.document,
    h = l.documentElement,
    d = encodeURIComponent("[]"),
    t = false,
    w = [],
    m = false,
    q = /^#?([\w-]+)$/,
    v = /^(\w+)\[\]$/,
    i = /\S/;
    a.mix(a, {
        isWindow: function(e) {
            return a.type(e) === "object" && "setInterval" in e
        },
        makeArray: function(e) {
            if (e === null || e === r) return [];
            if (a.isArray(e)) return e;
            if (typeof e.length !== "number" || a.isString(e) || a.isFunction(e)) return [e];
            return k(e)
        },
        param: function(e, c) {
            if (!a.isPlainObject(e)) return "";
            c = c || "&";
            var b = [],
            f,
            j;
            for (f in e) {
                j = e[f];
                f = encodeURIComponent(f);
                if (s(j)) b.push(f, "=", encodeURIComponent(j + ""), c);
                else if (a.isArray(j) && j.length) for (var n = 0,
                u = j.length; n < u; ++n) s(j[n]) && b.push(f, d + "=", encodeURIComponent(j[n] + ""), c)
            }
            b.pop();
            return b.join("")
        },
        unparam: function(e, c) {
            if (typeof e !== "string" || (e = a.trim(e)).length === 0) return {};
            for (var b = {},
            f = e.split(c || "&"), j, n, u, y, p = 0, x = f.length; p < x; ++p) {
                j = f[p].split("=");
                n = decodeURIComponent(j[0]);
                try {
                    u = decodeURIComponent(j[1] || "")
                } catch(z) {
                    u = j[1] || ""
                }
                if ((y = n.match(v)) && y[1]) {
                    b[y[1]] = b[y[1]] || [];
                    b[y[1]].push(u)
                } else b[n] = u
            }
            return b
        },
        globalEval: function(e) {
            if (e && i.test(e)) {
                var c = l.getElementsByTagName("head")[0] || h,
                b = l.createElement("script");
                b.text = e;
                c.insertBefore(b, c.firstChild);
                c.removeChild(b)
            }
        },
        later: function(e, c, b, f, j) {
            c = c || 0;
            f = f || {};
            var n = e,
            u = a.makeArray(j),
            y;
            if (a.isString(e)) n = f[e];
            n || a.error("method undefined");
            e = function() {
                n.apply(f, u)
            };
            y = b ? setInterval(e, c) : setTimeout(e, c);
            return {
                id: y,
                interval: b,
                cancel: function() {
                    this.interval ? clearInterval(y) : clearTimeout(y)
                }
            }
        },
        ready: function(e) {
            m || this._bindReady();
            t ? e.call(g, this) : w.push(e);
            return this
        },
        _bindReady: function() {
            var e = this,
            c = l.documentElement.doScroll,
            b = c ? "onreadystatechange": "DOMContentLoaded",
            f = function() {
                e._fireReady()
            };
            m = true;
            if (l.readyState === "complete") return f();
            if (l.addEventListener) {
                var j = function() {
                    l.removeEventListener(b, j, false);
                    f()
                };
                l.addEventListener(b, j, false);
                g.addEventListener("load", f, false)
            } else {
                var n = function() {
                    if (l.readyState === "complete") {
                        l.detachEvent(b, n);
                        f()
                    }
                };
                l.attachEvent(b, n);
                g.attachEvent("onload", f);
                var u = false;
                try {
                    u = g.frameElement == null
                } catch(y) {}
                if (c && u) {
                    var p = function() {
                        try {
                            c("left");
                            f()
                        } catch(x) {
                            setTimeout(p, 1)
                        }
                    };
                    p()
                }
            }
        },
        _fireReady: function() {
            if (!t) {
                t = true;
                if (w) {
                    for (var e, c = 0; e = w[c++];) e.call(g, this);
                    w = null
                }
            }
        },
        available: function(e, c) {
            if ((e = (e + "").match(q)[1]) && a.isFunction(c)) var b = 1,
            f = a.later(function() {
                if (l.getElementById(e) && (c() || 1) || ++b > 500) f.cancel()
            },
            40, true)
        }
    });
    try {
        k(h.childNodes)
    } catch(o) {
        k = function(e) {
            for (var c = [], b = e.length - 1; b >= 0; b--) c[b] = e[b];
            return c
        }
    }
    if (location && (location.search || "").indexOf("ks-debug") !== -1) a.Config.debug = true;
    a._bindReady()
})(KISSY); (function(a, r) {
    var s = a.__HOST.document,
    k = s.getElementsByTagName("head")[0] || s.documentElement,
    g = 2,
    l = 3,
    h = 4,
    d = a.mix,
    t = s.createElement("script").readyState ?
    function(i, o) {
        var e = i.onreadystatechange;
        i.onreadystatechange = function() {
            var c = i.readyState;
            if (c === "loaded" || c === "complete") {
                i.onreadystatechange = null;
                e && e();
                o.call(this)
            }
        }
    }: function(i, o) {
        i.addEventListener("load", o, false)
    },
    w = /\.css(?:\?|$)/i,
    m;
    m = {
        add: function(i, o, e) {
            var c = this.Env.mods,
            b;
            if (a.isString(i) && !e && a.isPlainObject(o)) {
                b = {};
                b[i] = o;
                i = b
            }
            if (a.isPlainObject(i)) {
                a.each(i,
                function(f, j) {
                    f.name = j;
                    c[j] && d(f, c[j], false)
                });
                d(c, i)
            } else {
                e = e || {};
                b = c[i] || {};
                i = e.host || b.host || i;
                b = c[i] || {};
                d(b, {
                    name: i,
                    status: g
                });
                if (!b.fns) b.fns = [];
                o && b.fns.push(o);
                o = b.requires;
                d(c[i] = b, e);
                c[i].requires = o;
                b.attach !== false && this.__isAttached(b.requires) && this.__attachMod(b)
            }
            return this
        },
        use: function(i, o, e) {
            i = i.replace(/\s+/g, "").split(",");
            e = e || {};
            var c = this,
            b = c.Env.mods,
            f = (e || 0).global,
            j,
            n = i.length,
            u,
            y,
            p;
            f && c.__mixMods(f);
            if (c.__isAttached(i)) o && o(c);
            else {
                for (j = 0; j < n && (u = b[i[j]]); j++) if (u.status !== h) {
                    if (e.order && j > 0) {
                        if (!u.requires) u.requires = [];
                        u._requires = u.requires.concat();
                        y = i[j - 1];
                        if (!a.inArray(y, u.requires) && !a.inArray(u.name, b[y].requires || [])) u.requires.push(y)
                    }
                    c.__attach(u,
                    function() {
                        if (u._requires) {
                            u.requires = u._requires;
                            delete u._requires
                        }
                        if (!p && c.__isAttached(i)) {
                            p = true;
                            o && o(c)
                        }
                    },
                    f)
                }
                return c
            }
        },
        __attach: function(i, o, e) {
            function c() {
                if (b.__isAttached(i.requires || [])) {
                    i.status === g && b.__attachMod(i);
                    i.status === h && o()
                }
            }
            for (var b = this,
            f = i.requires || [], j = 0, n = f.length; j < n; j++) b.__attach(b.Env.mods[f[j]], c, e);
            b.__buildPath(i);
            b.__load(i, c, e)
        },
        __mixMods: function(i) {
            var o = this.Env.mods,
            e = i.Env.mods,
            c;
            for (c in e) this.__mixMod(o, e, c, i)
        },
        __mixMod: function(i, o, e, c) {
            var b = i[e] || {},
            f = b.status;
            a.mix(b, a.clone(o[e]));
            if (f) b.status = f;
            c && this.__buildPath(b, c.Config.base);
            i[e] = b
        },
        __attachMod: function(i) {
            var o = this;
            if (i.fns) {
                a.each(i.fns,
                function(e) {
                    e && e(o)
                });
                i.fns = r
            }
            i.status = h
        },
        __isAttached: function(i) {
            for (var o = this.Env.mods,
            e, c = (i = a.makeArray(i)).length - 1; c >= 0 && (e = o[i[c]]); c--) if (e.status !== h) return false;
            return true
        },
        __load: function(i, o, e) {
            function c() {
                j[f] = g;
                if (i.status !== l) {
                    e && b.__mixMod(b.Env.mods, e.Env.mods, i.name, e);
                    if (i.status !== h) i.status = g;
                    o()
                }
            }
            var b = this,
            f = i.fullpath,
            j = a.Env._loadQueue,
            n = j[f];
            i.status = i.status || 0;
            if (i.status < 1 && n) i.status = n.nodeName ? 1 : g;
            if (a.isString(i.cssfullpath)) {
                b.getScript(i.cssfullpath);
                i.cssfullpath = g
            }
            if (i.status < 1 && f) {
                i.status = 1;
                n = b.getScript(f, {
                    success: function() {
                        KISSY.log(i.name + " is loaded.", "info");
                        c()
                    },
                    error: function() {
                        i.status = l;
                        j[f] = g
                    },
                    charset: i.charset
                });
                w.test(f) || (j[f] = n)
            } else i.status === 1 ? t(n, c) : o()
        },
        __buildPath: function(i, o) {
            function e(b, f) {
                if (!i[f] && i[b]) i[f] = (o || c.base) + i[b];
                if (i[f] && c.debug) i[f] = i[f].replace(/-min/g, "")
            }
            var c = this.Config;
            e("path", "fullpath");
            i.cssfullpath !== g && e("csspath", "cssfullpath")
        },
        getScript: function(i, o, e) {
            var c = w.test(i),
            b = s.createElement(c ? "link": "script"),
            f = o,
            j,
            n,
            u;
            if (a.isPlainObject(f)) {
                o = f.success;
                j = f.error;
                n = f.timeout;
                e = f.charset
            }
            if (c) {
                b.href = i;
                b.rel = "stylesheet"
            } else {
                b.src = i;
                b.async = true
            }
            if (e) b.charset = e;
            if (c) a.isFunction(o) && o.call(b);
            else t(b,
            function() {
                if (u) {
                    u.cancel();
                    u = r
                }
                a.isFunction(o) && o.call(b);
                k && b.parentNode && k.removeChild(b)
            });
            if (a.isFunction(j)) u = a.later(function() {
                u = r;
                j()
            },
            (n || this.Config.timeout) * 1E3);
            k.insertBefore(b, k.firstChild);
            return b
        }
    };
    d(a, m);
    var q = /^(.*)(seed|kissy)(-min)?\.js[^/] * /i,v=/ (seed | kissy)( - min) ? \.js / ; a.__initLoader = function() {
        var i = s.getElementsByTagName("script");
        i = i[i.length - 1];
        var o = i.src,
        e = i.getAttribute("data-combo-prefix") || "??";
        i = i.getAttribute("data-combo-sep") || ",";
        i = o.split(i);
        var c = i[0];
        e = c.indexOf(e);
        if (e == -1) o = o.replace(q, "$1");
        else {
            o = c.substring(0, e);
            e = c.substring(e + 2, c.length);
            if (e.match(v)) o += e.replace(q, "$1");
            else for (e = 1; e < i.length; e++) {
                c = i[e];
                if (c.match(v)) {
                    o += c.replace(q, "$1");
                    break
                }
            }
        }
        i = o;
        this.Env.mods = {};
        this.Env._loadQueue = {};
        if (!this.Config.base) this.Config.base = i;
        if (!this.Config.timeout) this.Config.timeout = 10
    }; a.__initLoader(); a.each(m,
    function(i, o) {
        a.__APP_MEMBERS.push(o)
    }); a.__APP_INIT_METHODS.push("__initLoader")
})(KISSY); (function(a) {
    var r = {
        core: {
            path: "packages/core-min.js",
            charset: "utf-8"
        }
    };
    a.each(["sizzle", "dd", "datalazyload", "flash", "switchable", "suggest", "calendar", "uibase", "overlay", "imagezoom", "waterfall", "template"],
    function(s) {
        r[s] = {
            path: s + "/" + s + "-pkg-min.js",
            requires: ["core"],
            charset: "utf-8"
        }
    });
    r.calendar.csspath = "calendar/default-min.css";
    r.overlay.requires = ["uibase"];
    r.waterfall.requires = ["template"];
    a.add(r)
})(KISSY);
KISSY.add("ua",
function(a) {
    var r = navigator.userAgent,
    s = "",
    k = "",
    g, l = {},
    h = function(d) {
        var t = 0;
        return parseFloat(d.replace(/\./g,
        function() {
            return t++===0 ? ".": ""
        }))
    };
    if ((g = r.match(/AppleWebKit\/([\d.]*)/)) && g[1]) {
        l[s = "webkit"] = h(g[1]);
        if ((g = r.match(/Chrome\/([\d.]*)/)) && g[1]) l[k = "chrome"] = h(g[1]);
        else if ((g = r.match(/\/([\d.]*) Safari/)) && g[1]) l[k = "safari"] = h(g[1]);
        if (/ Mobile\//.test(r)) l.mobile = "apple";
        else if (g = r.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/)) l.mobile = g[0].toLowerCase()
    } else if ((g = r.match(/Presto\/([\d.]*)/)) && g[1]) {
        l[s = "presto"] = h(g[1]);
        if ((g = r.match(/Opera\/([\d.]*)/)) && g[1]) {
            l[k = "opera"] = h(g[1]);
            if ((g = r.match(/Opera\/.* Version\/([\d.]*)/)) && g[1]) l[k] = h(g[1]);
            if ((g = r.match(/Opera Mini[^;]*/)) && g) l.mobile = g[0].toLowerCase();
            else if ((g = r.match(/Opera Mobi[^;]*/)) && g) l.mobile = g[0]
        }
    } else if ((g = r.match(/MSIE\s([^;]*)/)) && g[1]) {
        l[s = "trident"] = 0.1;
        l[k = "ie"] = h(g[1]);
        if ((g = r.match(/Trident\/([\d.]*)/)) && g[1]) l[s] = h(g[1])
    } else if (g = r.match(/Gecko/)) {
        l[s = "gecko"] = 0.1;
        if ((g = r.match(/rv:([\d.]*)/)) && g[1]) l[s] = h(g[1]);
        if ((g = r.match(/Firefox\/([\d.]*)/)) && g[1]) l[k = "firefox"] = h(g[1])
    }
    l.core = s;
    l.shell = k;
    l._numberify = h;
    a.UA = l
});
KISSY.add("ua-extra",
function(a) {
    var r = a.UA,
    s = navigator.userAgent,
    k, g, l = {},
    h = r._numberify;
    if (s.match(/360SE/)) l[g = "se360"] = 3;
    else if (s.match(/Maxthon/) && (k = window.external)) {
        g = "maxthon";
        try {
            l[g] = h(k.max_version)
        } catch(d) {
            l[g] = 0.1
        }
    } else if (k = s.match(/TencentTraveler\s([\d.]*)/)) l[g = "tt"] = k[1] ? h(k[1]) : 0.1;
    else if (s.match(/TheWorld/)) l[g = "theworld"] = 3;
    else if (k = s.match(/SE\s([\d.]*)/)) l[g = "sougou"] = k[1] ? h(k[1]) : 0.1;
    g && (l.shell = g);
    a.mix(r, l)
});
KISSY.add("dom",
function(a, r) {
    function s(k, g) {
        return k && k.nodeType === g
    }
    a.DOM = {
        _isElementNode: function(k) {
            return s(k, 1)
        },
        _isKSNode: function(k) {
            return a.Node && s(k, a.Node.TYPE)
        },
        _getWin: function(k) {
            return k && "scrollTo" in k && k.document ? k: s(k, 9) ? k.defaultView || k.parentWindow: k === r ? window: false
        },
        _nodeTypeIs: s
    }
});
KISSY.add("selector",
function(a, r) {
    function s(c, b) {
        var f, j, n = [],
        u;
        b = k(b);
        if (a.isString(c)) {
            c = a.trim(c);
            if (o.test(c)) {
                if (j = g(c.slice(1), b)) n = [j]
            } else if (f = e.exec(c)) {
                j = f[1];
                u = f[2];
                f = f[3];
                if (b = j ? g(j, b) : b) if (f) if (!j || c.indexOf(m) !== -1) n = h(f, u, b);
                else {
                    if ((j = g(j, b)) && w.hasClass(j, f)) n = [j]
                } else if (u) n = l(u, b)
            } else if (a.ExternalSelector) return a.ExternalSelector(c, b);
            else d(c)
        } else if (c && (c[v] || c[i])) n = c[v] ? [c[v]()] : c[i]();
        else if (c && (a.isArray(c) || c && !c.nodeType && c.item && c != window)) n = c;
        else if (c) n = [c];
        if (n && !n.nodeType && n.item && n != window) n = a.makeArray(n);
        n.each = function(y, p) {
            return a.each(n, y, p)
        };
        return n
    }
    function k(c) {
        if (c === r) c = t;
        else if (a.isString(c) && o.test(c)) c = g(c.slice(1), t);
        else if (c && c.nodeType !== 1 && c.nodeType !== 9) c = null;
        return c
    }
    function g(c, b) {
        if (b.nodeType !== 9) b = b.ownerDocument;
        return b.getElementById(c)
    }
    function l(c, b) {
        return b.getElementsByTagName(c)
    }
    function h(c, b, f) {
        f = c = f.getElementsByClassName(c);
        var j = 0,
        n = 0,
        u = c.length,
        y;
        if (b && b !== q) {
            f = [];
            for (b = b.toUpperCase(); j < u; ++j) {
                y = c[j];
                if (y.tagName === b) f[n++] = y
            }
        }
        return f
    }
    function d(c) {
        a.error("Unsupported selector: " + c)
    }
    var t = document,
    w = a.DOM,
    m = " ",
    q = "*",
    v = "getDOMNode",
    i = v + "s",
    o = /^#[\w-]+$/,
    e = /^(?:#([\w-]+))?\s*([\w-]+|\*)?\.?([\w-]+)?$/; (function() {
        var c = t.createElement("div");
        c.appendChild(t.createComment(""));
        if (c.getElementsByTagName(q).length > 0) l = function(b, f) {
            var j = f.getElementsByTagName(b);
            if (b === q) {
                for (var n = [], u = 0, y = 0, p; p = j[u++];) if (p.nodeType === 1) n[y++] = p;
                j = n
            }
            return j
        }
    })();
    t.getElementsByClassName || (h = t.querySelectorAll ?
    function(c, b, f) {
        return f.querySelectorAll((b ? b: "") + "." + c)
    }: function(c, b, f) {
        b = f.getElementsByTagName(b || q);
        f = [];
        var j = 0,
        n = 0,
        u = b.length,
        y, p;
        for (c = m + c + m; j < u; ++j) {
            y = b[j];
            if ((p = y.className) && (m + p + m).indexOf(c) > -1) f[n++] = y
        }
        return f
    });
    a.query = s;
    a.get = function(c, b) {
        return s(c, b)[0] || null
    };
    a.mix(w, {
        query: s,
        get: a.get,
        filter: function(c, b) {
            var f = s(c),
            j,
            n,
            u,
            y = [];
            if (a.isString(b) && (j = e.exec(b)) && !j[1]) {
                n = j[2];
                u = j[3];
                b = function(p) {
                    return ! (n && p.tagName !== n.toUpperCase() || u && !w.hasClass(p, u))
                }
            }
            if (a.isFunction(b)) y = a.filter(f, b);
            else if (b && a.ExternalSelector) y = a.ExternalSelector._filter(c, b + "");
            else d(b);
            return y
        },
        test: function(c, b) {
            var f = s(c);
            return f.length && w.filter(f, b).length === f.length
        }
    })
});
KISSY.add("dom-data",
function(a, r) {
    var s = window,
    k = a.DOM,
    g = "_ks_data_" + a.now(),
    l = {},
    h = {},
    d = {
        EMBED: 1,
        OBJECT: 1,
        APPLET: 1
    };
    a.mix(k, {
        data: function(t, w, m) {
            if (a.isPlainObject(w)) for (var q in w) k.data(t, q, w[q]);
            else if (m === r) {
                t = a.get(t);
                var v;
                if (! (!t || d[t.nodeName])) {
                    if (t == s) t = h;
                    v = (q = t && t.nodeType) ? l: t;
                    t = v[q ? t[g] : g];
                    if (a.isString(w) && t) return t[w];
                    return t
                }
            } else a.query(t).each(function(i) {
                if (! (!i || d[i.nodeName])) {
                    if (i == s) i = h;
                    var o = l,
                    e;
                    if (i && i.nodeType) {
                        if (! (e = i[g])) e = i[g] = a.guid()
                    } else {
                        e = g;
                        o = i
                    }
                    if (w && m !== r) {
                        o[e] || (o[e] = {});
                        o[e][w] = m
                    }
                }
            })
        },
        removeData: function(t, w) {
            a.query(t).each(function(m) {
                if (m) {
                    if (m == s) m = h;
                    var q, v = l,
                    i, o = m && m.nodeType;
                    if (o) q = m[g];
                    else {
                        v = m;
                        q = g
                    }
                    if (q) {
                        i = v[q];
                        if (w) {
                            if (i) {
                                delete i[w];
                                a.isEmptyObject(i) && k.removeData(m)
                            }
                        } else {
                            if (o) m.removeAttribute && m.removeAttribute(g);
                            else try {
                                delete m[g]
                            } catch(e) {}
                            o && delete v[q]
                        }
                    }
                }
            })
        }
    })
});
KISSY.add("dom-class",
function(a, r) {
    function s(h, d, t, w) {
        if (! (d = a.trim(d))) return w ? false: r;
        h = a.query(h);
        var m = 0,
        q = h.length;
        d = d.split(g);
        for (var v; m < q; m++) {
            v = h[m];
            if (k._isElementNode(v)) {
                v = t(v, d, d.length);
                if (v !== r) return v
            }
        }
        if (w) return false
    }
    var k = a.DOM,
    g = /[\.\s]\s*\.?/,
    l = /[\n\t]/g;
    a.mix(k, {
        hasClass: function(h, d) {
            return s(h, d,
            function(t, w, m) {
                if (t = t.className) {
                    t = " " + t + " ";
                    for (var q = 0,
                    v = true; q < m; q++) if (t.indexOf(" " + w[q] + " ") < 0) {
                        v = false;
                        break
                    }
                    if (v) return true
                }
            },
            true)
        },
        addClass: function(h, d) {
            s(h, d,
            function(t, w, m) {
                var q = t.className;
                if (q) {
                    var v = " " + q + " ";
                    q = q;
                    for (var i = 0; i < m; i++) if (v.indexOf(" " + w[i] + " ") < 0) q += " " + w[i];
                    t.className = a.trim(q)
                } else t.className = d
            })
        },
        removeClass: function(h, d) {
            s(h, d,
            function(t, w, m) {
                var q = t.className;
                if (q) if (m) {
                    q = (" " + q + " ").replace(l, " ");
                    for (var v = 0,
                    i; v < m; v++) for (i = " " + w[v] + " "; q.indexOf(i) >= 0;) q = q.replace(i, " ");
                    t.className = a.trim(q)
                } else t.className = ""
            })
        },
        replaceClass: function(h, d, t) {
            k.removeClass(h, d);
            k.addClass(h, t)
        },
        toggleClass: function(h, d, t) {
            var w = a.isBoolean(t),
            m;
            s(h, d,
            function(q, v, i) {
                for (var o = 0,
                e; o < i; o++) {
                    e = v[o];
                    m = w ? !t: k.hasClass(q, e);
                    k[m ? "removeClass": "addClass"](q, e)
                }
            })
        }
    })
});
KISSY.add("dom-attr",
function(a, r) {
    var s = a.UA,
    k = document.documentElement,
    g = !k.hasAttribute,
    l = k.textContent !== r ? "textContent": "innerText",
    h = a.DOM,
    d = h._isElementNode,
    t = /^(?:href|src|style)/,
    w = /^(?:href|src|colspan|rowspan)/,
    m = /\r/g,
    q = /^(?:radio|checkbox)/,
    v = {
        readonly: "readOnly"
    },
    i = {
        val: 1,
        css: 1,
        html: 1,
        text: 1,
        data: 1,
        width: 1,
        height: 1,
        offset: 1
    };
    g && a.mix(v, {
        "for": "htmlFor",
        "class": "className"
    });
    a.mix(h, {
        attr: function(o, e, c, b) {
            if (a.isPlainObject(e)) {
                b = c;
                for (var f in e) h.attr(o, f, e[f], b)
            } else if (e = a.trim(e)) {
                e = e.toLowerCase();
                if (b && i[e]) return h[e](o, c);
                e = v[e] || e;
                if (c === r) {
                    o = a.get(o);
                    if (!d(o)) return r;
                    var j;
                    t.test(e) || (j = o[e]);
                    if (j === r) j = o.getAttribute(e);
                    if (g) if (w.test(e)) j = o.getAttribute(e, 2);
                    else if (e === "style") j = o.style.cssText;
                    return j === null ? r: j
                }
                a.each(a.query(o),
                function(n) {
                    if (d(n)) if (e === "style") n.style.cssText = c;
                    else {
                        if (e === "checked") n[e] = !!c;
                        n.setAttribute(e, "" + c)
                    }
                })
            }
        },
        removeAttr: function(o, e) {
            a.each(a.query(o),
            function(c) {
                if (d(c)) {
                    h.attr(c, e, "");
                    c.removeAttribute(e)
                }
            })
        },
        val: function(o, e) {
            if (e === r) {
                var c = a.get(o);
                if (!d(c)) return r;
                if (c && c.nodeName.toUpperCase() === "option".toUpperCase()) return (c.attributes.value || {}).specified ? c.value: c.text;
                if (c && c.nodeName.toUpperCase() === "select".toUpperCase()) {
                    var b = c.selectedIndex,
                    f = c.options;
                    if (b < 0) return null;
                    else if (c.type === "select-one") return h.val(f[b]);
                    c = [];
                    for (var j = 0,
                    n = f.length; j < n; ++j) f[j].selected && c.push(h.val(f[j]));
                    return c
                }
                if (s.webkit && q.test(c.type)) return c.getAttribute("value") === null ? "on": c.value;
                return (c.value || "").replace(m, "")
            }
            a.each(a.query(o),
            function(u) {
                if (u && u.nodeName.toUpperCase() === "select".toUpperCase()) {
                    if (a.isNumber(e)) e += "";
                    var y = a.makeArray(e),
                    p = u.options,
                    x;
                    j = 0;
                    for (n = p.length; j < n; ++j) {
                        x = p[j];
                        x.selected = a.inArray(h.val(x), y)
                    }
                    if (!y.length) u.selectedIndex = -1
                } else if (d(u)) u.value = e
            })
        },
        text: function(o, e) {
            if (e === r) {
                var c = a.get(o);
                if (d(c)) return c[l] || "";
                else if (h._nodeTypeIs(c, 3)) return c.nodeValue
            } else a.each(a.query(o),
            function(b) {
                if (d(b)) b[l] = e;
                else if (h._nodeTypeIs(b, 3)) b.nodeValue = e
            })
        }
    })
});
KISSY.add("dom-style",
function(a, r) {
    function s(b, f) {
        var j = a.get(b),
        n = f === t ? j.offsetWidth: j.offsetHeight;
        a.each(f === t ? ["Left", "Right"] : ["Top", "Bottom"],
        function(u) {
            n -= parseFloat(g._getComputedStyle(j, "padding" + u)) || 0;
            n -= parseFloat(g._getComputedStyle(j, "border" + u + "Width")) || 0
        });
        return n
    }
    function k(b, f, j) {
        var n = j;
        if (j === w && q.test(f)) {
            n = 0;
            if (a.inArray(g.css(b, "position"), ["absolute", "fixed"])) {
                j = b[f === "left" ? "offsetLeft": "offsetTop"];
                if (l.ie === 8 || l.opera) j -= m(g.css(b.offsetParent, "border-" + f + "-width")) || 0;
                n = j - (m(g.css(b, "margin-" + f)) || 0)
            }
        }
        return n
    }
    var g = a.DOM,
    l = a.UA,
    h = document,
    d = h.documentElement,
    t = "width",
    w = "auto",
    m = parseInt,
    q = /^(?:left|top)/,
    v = /^(?:width|height|top|left|right|bottom|margin|padding)/i,
    i = /-([a-z])/ig,
    o = function(b, f) {
        return f.toUpperCase()
    },
    e = {},
    c = {};
    a.mix(g, {
        _CUSTOM_STYLES: e,
        _getComputedStyle: function(b, f) {
            var j = "",
            n = b.ownerDocument;
            if (b.style) j = n.defaultView.getComputedStyle(b, null)[f];
            return j
        },
        css: function(b, f, j) {
            if (a.isPlainObject(f)) for (var n in f) g.css(b, n, f[n]);
            else {
                if (f.indexOf("-") > 0) f = f.replace(i, o);
                f = e[f] || f;
                if (j === r) {
                    b = a.get(b);
                    n = "";
                    if (b && b.style) {
                        n = f.get ? f.get(b) : b.style[f];
                        if (n === "" && !f.get) n = k(b, f, g._getComputedStyle(b, f))
                    }
                    return n === r ? "": n
                } else {
                    if (j === null || j === "") j = "";
                    else if (!isNaN(new Number(j)) && v.test(f)) j += "px"; (f === t || f === "height") && parseFloat(j) < 0 || a.each(a.query(b),
                    function(u) {
                        if (u && u.style) {
                            f.set ? f.set(u, j) : u.style[f] = j;
                            if (j === "") u.style.cssText || u.removeAttribute("style")
                        }
                    })
                }
            }
        },
        width: function(b, f) {
            if (f === r) return s(b, t);
            else g.css(b, t, f)
        },
        height: function(b, f) {
            if (f === r) return s(b, "height");
            else g.css(b, "height", f)
        },
        show: function(b) {
            a.query(b).each(function(f) {
                if (f) {
                    f.style.display = g.data(f, "display") || "";
                    if (g.css(f, "display") === "none") {
                        var j = f.tagName,
                        n = c[j],
                        u;
                        if (!n) {
                            u = h.createElement(j);
                            h.body.appendChild(u);
                            n = g.css(u, "display");
                            g.remove(u);
                            c[j] = n
                        }
                        g.data(f, "display", n);
                        f.style.display = n
                    }
                }
            })
        },
        hide: function(b) {
            a.query(b).each(function(f) {
                if (f) {
                    var j = f.style,
                    n = j.display;
                    if (n !== "none") {
                        n && g.data(f, "display", n);
                        j.display = "none"
                    }
                }
            })
        },
        toggle: function(b) {
            a.query(b).each(function(f) {
                if (f) f.style.display === "none" ? g.show(f) : g.hide(f)
            })
        },
        addStyleSheet: function(b, f) {
            var j;
            if (f && (f = f.replace("#", ""))) j = a.get("#" + f);
            if (!j) {
                j = g.create("<style>", {
                    id: f
                });
                a.get("head").appendChild(j);
                if (j.styleSheet) j.styleSheet.cssText = b;
                else j.appendChild(h.createTextNode(b))
            }
        }
    });
    if (d.style.cssFloat !== r) e["float"] = "cssFloat";
    else if (d.style.styleFloat !== r) e["float"] = "styleFloat"
});
KISSY.add("dom-style-ie",
function(a, r) {
    if (a.UA.ie) {
        var s = a.DOM,
        k = document,
        g = k.documentElement,
        l = s._CUSTOM_STYLES,
        h = /^-?\d+(?:px)?$/i,
        d = /^-?\d/,
        t = /^(?:width|height)$/;
        try {
            if (g.style.opacity === r && g.filters) l.opacity = {
                get: function(m) {
                    var q = 100;
                    try {
                        q = m.filters["DXImageTransform.Microsoft.Alpha"].opacity
                    } catch(v) {
                        try {
                            q = m.filters("alpha").opacity
                        } catch(i) {}
                    }
                    return q / 100 + ""
                },
                set: function(m, q) {
                    var v = m.style,
                    i = (m.currentStyle || 0).filter || "";
                    v.zoom = 1;
                    if (i) if (i = i.replace(/alpha\(opacity=.+\)/ig, "")) i += ", ";
                    v.filter = i + "alpha(opacity=" + q * 100 + ")"
                }
            }
        } catch(w) {
            a.log("IE filters ActiveX is disabled. ex = " + w)
        }
        if (! (k.defaultView || {}).getComputedStyle && g.currentStyle) s._getComputedStyle = function(m, q) {
            var v = m.style,
            i = m.currentStyle[q];
            if (t.test(q)) i = s[q](m) + "px";
            else if (!h.test(i) && d.test(i)) {
                var o = v.left,
                e = m.runtimeStyle.left;
                m.runtimeStyle.left = m.currentStyle.left;
                v.left = q === "fontSize" ? "1em": i || 0;
                i = v.pixelLeft + "px";
                v.left = o;
                m.runtimeStyle.left = e
            }
            return i
        }
    }
});
KISSY.add("dom-offset",
function(a, r) {
    function s(j) {
        var n = 0,
        u = 0,
        y = w(j[i]);
        if (j[f]) {
            j = j[f]();
            n = j[o];
            u = j[e];
            if (g.mobile !== "apple") {
                n += k[c](y);
                u += k[b](y)
            }
        }
        return {
            left: n,
            top: u
        }
    }
    var k = a.DOM,
    g = a.UA,
    l = window,
    h = document,
    d = k._isElementNode,
    t = k._nodeTypeIs,
    w = k._getWin,
    m = h.compatMode === "CSS1Compat",
    q = Math.max,
    v = parseInt,
    i = "ownerDocument",
    o = "left",
    e = "top",
    c = "scrollLeft",
    b = "scrollTop",
    f = "getBoundingClientRect";
    a.mix(k, {
        offset: function(j, n) {
            if (! (j = a.get(j)) || !j[i]) return null;
            if (n === r) return s(j);
            var u = j;
            if (k.css(u, "position") === "static") u.style.position = "relative";
            var y = s(u),
            p = {},
            x,
            z;
            for (z in n) {
                x = v(k.css(u, z), 10) || 0;
                p[z] = x + n[z] - y[z]
            }
            k.css(u, p)
        },
        scrollIntoView: function(j, n, u, y) {
            if ((j = a.get(j)) && j[i]) {
                y = y === r ? true: !!y;
                u = u === r ? true: !!u;
                if (!n || n === l) return j.scrollIntoView(u);
                n = a.get(n);
                if (t(n, 9)) n = w(n);
                var p = n && "scrollTo" in n && n.document,
                x = k.offset(j),
                z = p ? {
                    left: k.scrollLeft(n),
                    top: k.scrollTop(n)
                }: k.offset(n),
                A = {
                    left: x[o] - z[o],
                    top: x[e] - z[e]
                };
                x = p ? k.viewportHeight(n) : n.clientHeight;
                z = p ? k.viewportWidth(n) : n.clientWidth;
                var C = k[c](n),
                E = k[b](n),
                D = C + z,
                B = E + x,
                K = j.offsetHeight;
                j = j.offsetWidth;
                var J = A.left + C - (v(k.css(n, "borderLeftWidth")) || 0);
                A = A.top + E - (v(k.css(n, "borderTopWidth")) || 0);
                var G = J + j,
                F = A + K,
                H, I;
                if (K > x || A < E || u) H = A;
                else if (F > B) H = F - x;
                if (y) if (j > z || J < C || u) I = J;
                else if (G > D) I = G - z;
                if (p) {
                    if (H !== r || I !== r) n.scrollTo(I, H)
                } else {
                    if (H !== r) n[b] = H;
                    if (I !== r) n[c] = I
                }
            }
        }
    });
    a.each(["Left", "Top"],
    function(j, n) {
        var u = "scroll" + j;
        k[u] = function(y) {
            var p = 0,
            x = w(y),
            z;
            if (x && (z = x.document)) p = x[n ? "pageYOffset": "pageXOffset"] || z.documentElement[u] || z.body[u];
            else if (d(y = a.get(y))) p = y[u];
            return p
        }
    });
    a.each(["Width", "Height"],
    function(j) {
        k["doc" + j] = function(n) {
            n = n || h;
            return q(m ? n.documentElement["scroll" + j] : n.body["scroll" + j], k["viewport" + j](n))
        };
        k["viewport" + j] = function(n) {
            var u = "inner" + j;
            n = w(n);
            var y = n.document;
            return u in n ? n[u] : m ? y.documentElement["client" + j] : y.body["client" + j]
        }
    })
});
KISSY.add("dom-traversal",
function(a, r) {
    function s(h, d, t, w) {
        if (! (h = a.get(h))) return null;
        if (d === r) d = 1;
        var m = null,
        q, v;
        if (a.isNumber(d) && d >= 0) {
            if (d === 0) return h;
            q = 0;
            v = d;
            d = function() {
                return++q === v
            }
        }
        for (; h = h[t];) if (l(h) && (!d || g.test(h, d)) && (!w || w(h))) {
            m = h;
            break
        }
        return m
    }
    function k(h, d, t) {
        var w = [];
        var m = h = a.get(h);
        if (h && t) m = h.parentNode;
        if (m) {
            t = 0;
            for (m = m.firstChild; m; m = m.nextSibling) if (l(m) && m !== h && (!d || g.test(m, d))) w[t++] = m
        }
        return w
    }
    var g = a.DOM,
    l = g._isElementNode;
    a.mix(g, {
        parent: function(h, d) {
            return s(h, d, "parentNode",
            function(t) {
                return t.nodeType != 11
            })
        },
        next: function(h, d) {
            return s(h, d, "nextSibling")
        },
        prev: function(h, d) {
            return s(h, d, "previousSibling")
        },
        siblings: function(h, d) {
            return k(h, d, true)
        },
        children: function(h, d) {
            return k(h, d)
        },
        contains: function(h, d) {
            var t = false;
            if ((h = a.get(h)) && (d = a.get(d))) if (h.contains) {
                if (d.nodeType === 3) {
                    d = d.parentNode;
                    if (d === h) return true
                }
                if (d) return h.contains(d)
            } else if (h.compareDocumentPosition) return !! (h.compareDocumentPosition(d) & 16);
            else for (; ! t && (d = d.parentNode);) t = d == h;
            return t
        }
    })
});
KISSY.add("dom-create",
function(a, r) {
    function s(p) {
        var x = p.cloneNode(true);
        if (d.ie < 8) x.innerHTML = p.innerHTML;
        return x
    }
    function k(p, x, z, A) {
        if (z) {
            var C = a.guid("ks-tmp-"),
            E = RegExp(o);
            x += '<span id="' + C + '"></span>';
            a.available(C,
            function() {
                var D = a.get("head"),
                B,
                K,
                J,
                G,
                F,
                H;
                for (E.lastIndex = 0; B = E.exec(x);) if ((J = (K = B[1]) ? K.match(c) : false) && J[2]) {
                    B = l.createElement("script");
                    B.src = J[2];
                    if ((G = K.match(b)) && G[2]) B.charset = G[2];
                    B.async = true;
                    D.appendChild(B)
                } else if ((H = B[2]) && H.length > 0) a.globalEval(H); (F = l.getElementById(C)) && h.remove(F);
                a.isFunction(A) && A()
            });
            g(p, x)
        } else {
            g(p, x);
            a.isFunction(A) && A()
        }
    }
    function g(p, x) {
        x = (x + "").replace(o, "");
        try {
            p.innerHTML = x
        } catch(z) {
            for (; p.firstChild;) p.removeChild(p.firstChild);
            x && p.appendChild(h.create(x))
        }
    }
    var l = document,
    h = a.DOM,
    d = a.UA,
    t = d.ie,
    w = h._nodeTypeIs,
    m = h._isElementNode,
    q = h._isKSNode,
    v = l.createElement("div"),
    i = /<(\w+)/,
    o = /<script([^>]*)>([^<]*(?:(?!<\/script>)<[^<]*)*)<\/script>/ig,
    e = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
    c = /\ssrc=(['"])(.*?)\1/i,
    b = /\scharset=(['"])(.*?)\1/i;
    a.mix(h, {
        create: function(p, x, z) {
            if (w(p, 1) || w(p, 3)) return s(p);
            if (q(p)) return s(p[0]);
            if (! (p = a.trim(p))) return null;
            var A = null;
            A = h._creators;
            var C, E = "div",
            D;
            if (C = e.exec(p)) A = (z || l).createElement(C[1]);
            else {
                if ((C = i.exec(p)) && (D = C[1]) && a.isFunction(A[D = D.toLowerCase()])) E = D;
                p = A[E](p, z).childNodes;
                if (p.length === 1) z = p[0].parentNode.removeChild(p[0]);
                else {
                    p = p;
                    D = z || l;
                    z = null;
                    if (p && (p.push || p.item) && p[0]) {
                        D = D || p[0].ownerDocument;
                        z = D.createDocumentFragment();
                        if (p.item) p = a.makeArray(p);
                        D = 0;
                        for (A = p.length; D < A; D++) z.appendChild(p[D])
                    } else a.log("Unable to convert " + p + " to fragment.");
                    z = z
                }
                A = z
            }
            z = A;
            m(z) && a.isPlainObject(x) && h.attr(z, x, true);
            return z
        },
        _creators: {
            div: function(p, x) {
                var z = x ? x.createElement("div") : v;
                z.innerHTML = p;
                return z
            }
        },
        html: function(p, x, z, A) {
            if (x === r) {
                p = a.get(p);
                if (m(p)) return p.innerHTML
            } else a.each(a.query(p),
            function(C) {
                m(C) && k(C, x, z, A)
            })
        },
        remove: function(p) {
            a.each(a.query(p),
            function(x) {
                m(x) && x.parentNode && x.parentNode.removeChild(x)
            })
        }
    });
    if (t || d.gecko || d.webkit) {
        var f = h._creators,
        j = h.create,
        n = /(?:\/(?:thead|tfoot|caption|col|colgroup)>)+\s*<tbody/,
        u = {
            option: "select",
            td: "tr",
            tr: "tbody",
            tbody: "table",
            col: "colgroup",
            legend: "fieldset"
        },
        y;
        for (y in u)(function(p) {
            f[y] = function(x, z) {
                return j("<" + p + ">" + x + "</" + p + ">", null, z)
            }
        })(u[y]);
        if (t) {
            f.script = function(p, x) {
                var z = x ? x.createElement("div") : v;
                z.innerHTML = "-" + p;
                z.removeChild(z.firstChild);
                return z
            };
            if (t < 8) f.tbody = function(p, x) {
                var z = j("<table>" + p + "</table>", null, x),
                A = z.children.tags("tbody")[0];
                z.children.length > 1 && A && !n.test(p) && A.parentNode.removeChild(A);
                return z
            }
        }
        a.mix(f, {
            optgroup: f.option,
            th: f.td,
            thead: f.tbody,
            tfoot: f.tbody,
            caption: f.tbody,
            colgroup: f.tbody
        })
    }
});
KISSY.add("dom-insertion",
function(a) {
    var r = a.DOM;
    a.mix(r, {
        insertBefore: function(s, k) {
            if ((s = a.get(s)) && (k = a.get(k)) && k.parentNode) k.parentNode.insertBefore(s, k);
            return s
        },
        insertAfter: function(s, k) {
            if ((s = a.get(s)) && (k = a.get(k)) && k.parentNode) k.nextSibling ? k.parentNode.insertBefore(s, k.nextSibling) : k.parentNode.appendChild(s);
            return s
        },
        append: function(s, k) {
            if ((s = a.get(s)) && (k = a.get(k))) k.appendChild && k.appendChild(s)
        },
        prepend: function(s, k) {
            if ((s = a.get(s)) && (k = a.get(k))) k.firstChild ? r.insertBefore(s, k.firstChild) : k.appendChild(s)
        }
    })
});
KISSY.add("event",
function(a, r) {
    function s(o, e, c, b, f) {
        if (a.isString(e)) e = a.query(e);
        if (a.isArray(e)) {
            a.each(e,
            function(n) {
                i[o](n, c, b, f)
            });
            return true
        }
        if ((c = a.trim(c)) && c.indexOf(m) > 0) {
            a.each(c.split(m),
            function(n) {
                i[o](e, n, b, f)
            });
            return true
        }
       
    }
    function k(o, e) {
        g(o) && h.data(o, w, e)
    }
    function g(o) {
        return o && o.nodeType !== 3 && o.nodeType !== 8
    }
    var l = document,
    h = a.DOM,
    d = l.addEventListener ?
    function(o, e, c, b) {
        o.addEventListener && o.addEventListener(e, c, !!b)
    }: function(o, e, c) {
        o.attachEvent && o.attachEvent("on" + e, c)
    },
    t = l.removeEventListener ?
    function(o, e, c, b) {
        o.removeEventListener && o.removeEventListener(e, c, !!b)
    }: function(o, e, c) {
        o.detachEvent && o.detachEvent("on" + e, c)
    },
    w = "ksEventTargetId",
    m = " ",
    q = a.now(),
    v = {},
    i = {
        EVENT_GUID: w,
        special: {},
        add: function(o, e, c, b) {
            if (!s("add", o, e, c, b)) {
                var f = g(o) ? h.data(o, w) : -1,
                j,
                n,
                u,
                y,
                p;
                if (! (f === -1 || !e || !a.isFunction(c))) {
                    if (!f) {
                        k(o, f = q++);
                        v[f] = {
                            target: o,
                            events: {}
                        }
                    }
                    n = v[f].events;
                    if (!n[e]) {
                        j = ((f = !o.isCustomEventTarget) || o._supportSpecialEvent) && i.special[e] || {};
                        u = function(x, z) {
                            if (!x || !x.fixed) x = new a.EventObject(o, x, e);
                            a.isPlainObject(z) && a.mix(x, z);
                            j.setup && j.setup(x);
                            return (j.handle || i._handle)(o, x, n[e].listeners)
                        };
                        n[e] = {
                            handle: u,
                            listeners: []
                        };
                        y = j.fix || e;
                        p = j.capture;
                        if (f) d(o, y, u, p);
                        else o._addEvent && o._addEvent(y, u, p)
                    }
                    n[e].listeners.push({
                        fn: c,
                        scope: b || o
                    })
                }
            }
        },
        remove: function(o, e, c, b) {
            if (!s("remove", o, e, c, b)) {
                var f = g(o) ? h.data(o, w) : -1,
                j,
                n,
                u,
                y,
                p,
                x,
                z;
                if (f !== -1) if (f && (j = v[f])) if (j.target === o) {
                    b = b || o;
                    j = j.events || {};
                    if (n = j[e]) {
                        u = n.listeners;
                        x = u.length;
                        if (a.isFunction(c) && x) {
                            p = y = 0;
                            for (z = []; y < x; ++y) if (c !== u[y].fn || b !== u[y].scope) z[p++] = u[y];
                            n.listeners = z;
                            x = z.length
                        }
                        if (c === r || x === 0) {
                            if (o.isCustomEventTarget) o._removeEvent && o._removeEvent(e, n.handle);
                            else {
                                c = i.special[e] || {};
                                t(o, c.fix || e, n.handle)
                            }
                            delete j[e]
                        }
                    }
                    if (e === r || a.isEmptyObject(j)) {
                        for (e in j) i.remove(o, e);
                        delete v[f];
                        h.removeData(o, w)
                    }
                }
            }
        },
        _handle: function(o, e, c) {
            c = c.slice(0);
            var b;
            o = 0;
            for (var f = c.length; o < f; ++o) {
                b = c[o];
                b = b.fn.call(b.scope, e);
                if (b !== r) {
                    e.result = b;
                    b === false && e.halt()
                }
                if (e.isImmediatePropagationStopped) break
            }
            return b
        },
        _getCache: function(o) {
            return v[o]
        },
        _simpleAdd: d,
        _simpleRemove: t
    };
    i.on = i.add;
    a.Event = i
});
KISSY.add("event-object",
function(a, r) {
    function s(l, h, d) {
        this.currentTarget = l;
        this.originalEvent = h || {};
        if (h) {
            this.type = h.type;
            this._fix()
        } else {
            this.type = d;
            this.target = l
        }
        if (l.isCustomEventTarget) if (a.DOM._isKSNode(l)) this.target = new a.Node(this.target);
        this.currentTarget = l;
        this.fixed = true
    }
    var k = document,
    g = "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" ");
    a.augment(s, {
        _fix: function() {
            var l = this.originalEvent,
            h = g.length,
            d, t = this.currentTarget;
            for (t = t.nodeType === 9 ? t: t.ownerDocument || k; h;) {
                d = g[--h];
                this[d] = l[d]
            }
            if (!this.target) this.target = this.srcElement || k;
            if (this.target.nodeType === 3) this.target = this.target.parentNode;
            if (!this.relatedTarget && this.fromElement) this.relatedTarget = this.fromElement === this.target ? this.toElement: this.fromElement;
            if (this.pageX === r && this.clientX !== r) {
                l = t.documentElement;
                h = t.body;
                this.pageX = this.clientX + (l && l.scrollLeft || h && h.scrollLeft || 0) - (l && l.clientLeft || h && h.clientLeft || 0);
                this.pageY = this.clientY + (l && l.scrollTop || h && h.scrollTop || 0) - (l && l.clientTop || h && h.clientTop || 0)
            }
            if (this.which === r) this.which = this.charCode !== r ? this.charCode: this.keyCode;
            if (this.metaKey === r) this.metaKey = this.ctrlKey;
            if (!this.which && this.button !== r) this.which = this.button & 1 ? 1 : this.button & 2 ? 3 : this.button & 4 ? 2 : 0
        },
        preventDefault: function() {
            var l = this.originalEvent;
            if (l.preventDefault) l.preventDefault();
            else l.returnValue = false;
            this.isDefaultPrevented = true
        },
        stopPropagation: function() {
            var l = this.originalEvent;
            if (l.stopPropagation) l.stopPropagation();
            else l.cancelBubble = true;
            this.isPropagationStopped = true
        },
        stopImmediatePropagation: function() {
            var l = this.originalEvent;
            l.stopImmediatePropagation ? l.stopImmediatePropagation() : this.stopPropagation();
            this.isImmediatePropagationStopped = true
        },
        halt: function(l) {
            l ? this.stopImmediatePropagation() : this.stopPropagation();
            this.preventDefault()
        }
    });
    a.EventObject = s
});
KISSY.add("event-target",
function(a, r) {
    var s = a.Event;
    a.EventTarget = {
        isCustomEventTarget: true,
        fire: function(k, g) {
            var l = a.DOM.data(this, s.EVENT_GUID) || -1;
            if ((l = ((s._getCache(l) || {}).events || {})[k]) && a.isFunction(l.handle)) return l.handle(r, g);
            return this
        },
        on: function(k, g, l) {
            s.add(this, k, g, l);
            return this
        },
        detach: function(k, g, l) {
            s.remove(this, k, g, l);
            return this
        }
    }
});
KISSY.add("event-mouseenter",
function(a) {
    var r = a.Event;
    a.UA.ie || a.each([{
        name: "mouseenter",
        fix: "mouseover"
    },
    {
        name: "mouseleave",
        fix: "mouseout"
    }],
    function(s) {
        r.special[s.name] = {
            fix: s.fix,
            setup: function(k) {
                k.type = s.name
            },
            handle: function(k, g, l) {
                if (a.DOM._isKSNode(k)) k = k[0];
                var h = g.relatedTarget;
                try {
                    for (; h && h !== k;) h = h.parentNode;
                    h !== k && r._handle(k, g, l)
                } catch(d) {
                    a.log(d)
                }
            }
        }
    })
});
KISSY.add("event-focusin",
function(a) {
    var r = a.Event;
    document.addEventListener && a.each([{
        name: "focusin",
        fix: "focus"
    },
    {
        name: "focusout",
        fix: "blur"
    }],
    function(s) {
        r.special[s.name] = {
            fix: s.fix,
            capture: true,
            setup: function(k) {
                k.type = s.name
            }
        }
    })
});
KISSY.add("node",
function(a) {
    function r(k, g, l) {
        if (! (this instanceof r)) return new r(k, g, l);
        if (k) {
            if (a.isString(k)) {
                k = s.create(k, g, l);
                if (k.nodeType === 11) return new a.NodeList(k.childNodes)
            } else if (k instanceof r) return k;
            else k = k;
            this[0] = k
        } else this.length = 0
    }
    var s = a.DOM;
    r.TYPE = "-ks-Node";
    a.augment(r, {
        length: 1,
        getDOMNode: function() {
            return this[0]
        },
        nodeType: r.TYPE
    });
    a.one = function(k, g) {
        var l = a.get(k, g);
        return l ? new r(l) : null
    };
    a.Node = r
});
KISSY.add("nodelist",
function(a) {
    function r(g) {
        if (! (this instanceof r)) return new r(g);
        s.push.apply(this, a.makeArray(g) || [])
    }
    var s = Array.prototype,
    k = a.DOM._isElementNode;
    a.mix(r.prototype, {
        length: 0,
        item: function(g) {
            var l = null,
            h, d;
            if (k(g)) {
                h = 0;
                for (d = this.length; h < d; h++) if (g === this[h]) {
                    g = h;
                    break
                }
            }
            if (k(this[g])) l = new a.Node(this[g]);
            return l
        },
        getDOMNodes: function() {
            return s.slice.call(this)
        },
        each: function(g, l) {
            var h = this.length,
            d = 0,
            t;
            for (t = new a.Node(this[0]); d < h && g.call(l || t, t, d, this) !== false; t = new a.Node(this[++d]));
            return this
        }
    });
    a.all = function(g, l) {
        return new r(a.query(g, l, true))
    };
    a.NodeList = r
});
KISSY.add("node-attach",
function(a, r) {
    function s(b, f, j, n) {
        b = [this[b ? i: v]()].concat(a.makeArray(f));
        if (f[j] === r) return n.apply(h, b);
        else {
            n.apply(h, b);
            return this
        }
    }
    function k(b, f) {
        a.each(b,
        function(j) {
            a.each([m, q],
            function(n, u) {
                n[j] = function(y) {
                    switch (f) {
                    case o:
                        return function() {
                            return s.call(this, u, arguments, 1, y)
                        };
                    case e:
                        return function() {
                            return s.call(this, u, arguments, 0, y)
                        };
                    case c:
                        return function() {
                            var p = this[u ? i: v]();
                            return (p = y.apply(h, [p].concat(a.makeArray(arguments)))) ? new(a[a.isArray(p) ? "NodeList": "Node"])(p) : null
                        };
                    default:
                        return function() {
                            var p = this[u ? i: v]();
                            p = y.apply(h, [p].concat(a.makeArray(arguments)));
                            return p === r ? this: p
                        }
                    }
                } (h[j])
            })
        })
    }
    function g(b, f, j) {
        b && a.each(this,
        function(n) {
            var u;
            if (f || a.isString(b)) u = h.create(b);
            else {
                if (t(b, 1) || t(b, 3)) u = b;
                if (w(b)) u = b[0]
            }
            h[j](u, n)
        });
        return this
    }
    function l(b, f) {
        if ((b = a.get(b)) && b.appendChild) a.each(this,
        function(j) {
            h[f](j, b)
        });
        return this
    }
    var h = a.DOM,
    d = a.Event,
    t = h._nodeTypeIs,
    w = h._isKSNode,
    m = a.Node.prototype,
    q = a.NodeList.prototype,
    v = "getDOMNode",
    i = v + "s",
    o = 1,
    e = 2,
    c = 4;
    a.mix(m, {
        one: function(b) {
            return a.one(b, this[0])
        },
        all: function(b) {
            return a.all(b, this[0])
        }
    });
    k(["data", "removeData"], o);
    k(["hasClass", "addClass", "removeClass", "replaceClass", "toggleClass"]);
    k(["attr", "removeAttr"], o);
    k(["val", "text"], e);
    k(["css"], o);
    k(["width", "height"], e);
    k(["offset"], e);
    k(["scrollIntoView"]);
    k(["parent", "next", "prev", "siblings", "children"], c);
    k(["contains"]);
    k(["html"], e);
    k(["remove"]);
    a.each(["insertBefore", "insertAfter"],
    function(b) {
        m[b] = function(f) {
            h[b].call(h, this[0], f);
            return this
        }
    });
    a.each([m, q],
    function(b, f) {
        a.each(["append", "prepend"],
        function(j) {
            b[j] = function(n) {
                return g.call(this, n, f, j)
            };
            b[j + "To"] = function(n) {
                return l.call(this, n, j)
            }
        })
    });
    a.mix(m, a.EventTarget);
    m._supportSpecialEvent = true;
    m._addEvent = function(b, f, j) {
        d._simpleAdd(this[0], b, f, j)
    };
    m._removeEvent = function(b, f, j) {
        d._simpleRemove(this[0], b, f, j)
    };
    delete m.fire;
    a.mix(q, a.EventTarget);
    delete q.fire
});
if (!this.JSON) this.JSON = {}; (function() {
    function a(w) {
        return w < 10 ? "0" + w: w
    }
    function r(w) {
        g.lastIndex = 0;
        return g.test(w) ? '"' + w.replace(g,
        function(m) {
            var q = d[m];
            return typeof q === "string" ? q: "\\u" + ("0000" + m.charCodeAt(0).toString(16)).slice( - 4)
        }) + '"': '"' + w + '"'
    }
    function s(w, m) {
        var q, v, i, o, e = l,
        c, b = m[w];
        if (b && typeof b === "object" && typeof b.toJSON === "function") b = b.toJSON(w);
        if (typeof t === "function") b = t.call(m, w, b);
        switch (typeof b) {
        case "string":
            return r(b);
        case "number":
            return isFinite(b) ? String(b) : "null";
        case "boolean":
        case "null":
            return String(b);
        case "object":
            if (!b) return "null";
            l += h;
            c = [];
            if (Object.prototype.toString.apply(b) === "[object Array]") {
                o = b.length;
                for (q = 0; q < o; q += 1) c[q] = s(q, b) || "null";
                i = c.length === 0 ? "[]": l ? "[\n" + l + c.join(",\n" + l) + "\n" + e + "]": "[" + c.join(",") + "]";
                l = e;
                return i
            }
            if (t && typeof t === "object") {
                o = t.length;
                for (q = 0; q < o; q += 1) {
                    v = t[q];
                    if (typeof v === "string") if (i = s(v, b)) c.push(r(v) + (l ? ": ": ":") + i)
                }
            } else for (v in b) if (Object.hasOwnProperty.call(b, v)) if (i = s(v, b)) c.push(r(v) + (l ? ": ": ":") + i);
            i = c.length === 0 ? "{}": l ? "{\n" + l + c.join(",\n" + l) + "\n" + e + "}": "{" + c.join(",") + "}";
            l = e;
            return i
        }
    }
    if (typeof Date.prototype.toJSON !== "function") {
        Date.prototype.toJSON = function() {
            return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + a(this.getUTCMonth() + 1) + "-" + a(this.getUTCDate()) + "T" + a(this.getUTCHours()) + ":" + a(this.getUTCMinutes()) + ":" + a(this.getUTCSeconds()) + "Z": null
        };
        String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
            return this.valueOf()
        }
    }
    var k = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
    g = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
    l, h, d = {
        "": "\\b",
        "\t": "\\t",
        "\n": "\\n",
        "": "\\f",
        "\r": "\\r",
        '"': '\\"',
        "\\": "\\\\"
    },
    t;
    if (typeof JSON.stringify !== "function") JSON.stringify = function(w, m, q) {
        var v;
        h = l = "";
        if (typeof q === "number") for (v = 0; v < q; v += 1) h += " ";
        else if (typeof q === "string") h = q;
        if ((t = m) && typeof m !== "function" && (typeof m !== "object" || typeof m.length !== "number")) throw Error("JSON.stringify");
        return s("", {
            "": w
        })
    };
    if (typeof JSON.parse !== "function") JSON.parse = function(w, m) {
        function q(i, o) {
            var e, c, b = i[o];
            if (b && typeof b === "object") for (e in b) if (Object.hasOwnProperty.call(b, e)) {
                c = q(b, e);
                if (c !== undefined) b[e] = c;
                else delete b[e]
            }
            return m.call(i, o, b)
        }
        var v;
        w = String(w);
        k.lastIndex = 0;
        if (k.test(w)) w = w.replace(k,
        function(i) {
            return "\\u" + ("0000" + i.charCodeAt(0).toString(16)).slice( - 4)
        });
        if (/^[\],:{}\s]*$/.test(w.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) {
            v = eval("(" + w + ")");
            return typeof m === "function" ? q({
                "": v
            },
            "") : v
        }
        throw new SyntaxError("JSON.parse");
    }
})();
KISSY.add("json",
function(a) {
    var r = window.JSON;
    a.JSON = {
        parse: function(s) {
            if (s == null || s === "") return null;
            return r.parse(s)
        },
        stringify: r.stringify
    }
});
KISSY.add("ajax",
function(a, r) {
    function s(p) {
        p = a.merge(y, p);
        if (p.url) {
            if (p.data && !a.isString(p.data)) p.data = a.param(p.data);
            p.context = p.context || p;
            var x, z = b,
            A, C = p.type.toUpperCase();
            if (p.dataType === q) {
                x = p.jsonpCallback || q + a.now();
                p.url = p.url + (p.url.indexOf("?") === -1 ? "?": "&") + (p.jsonp + "=" + x);
                p.dataType = v;
                var E = l[x];
                l[x] = function(G) {
                    if (a.isFunction(E)) E(G);
                    else {
                        l[x] = r;
                        try {
                            delete l[x]
                        } catch(F) {}
                    }
                    k([b, f], G, z, B, p)
                }
            }
            if (p.data && C === d) p.url = p.url + (p.url.indexOf("?") === -1 ? "?": "&") + p.data;
            if (p.dataType === v) {
                g(o, p);
                C = a.getScript(p.url, x ? null: function() {
                    k([b, f], i, z, B, p)
                });
                g(e, p);
                return C
            }
            var D = false,
            B = p.xhr();
            g(o, p);
            B.open(C, p.url, p.async);
            try {
                if (p.data || p.contentType) B.setRequestHeader(w, p.contentType);
                B.setRequestHeader("Accept", p.dataType && p.accepts[p.dataType] ? p.accepts[p.dataType] + ", */*; q=0.01": p.accepts._default)
            } catch(K) {}
            B.onreadystatechange = function(G) {
                if (!B || B.readyState === 0 || G === "abort") {
                    D || k(f, null, j, B, p);
                    D = true;
                    if (B) B.onreadystatechange = h
                } else if (!D && B && (B.readyState === 4 || G === n)) {
                    D = true;
                    B.onreadystatechange = h;
                    var F;
                    if (G === n) F = n;
                    else {
                        a: {
                            try {
                                F = B.status >= 200 && B.status < 300 || B.status === 304 || B.status === 1223;
                                break a
                            } catch(H) {}
                            F = false
                        }
                        F = F ? b: j
                    }
                    z = F;
                    try {
                        F = B;
                        var I = p.dataType,
                        M = i,
                        N, L = F;
                        if (!a.isString(L)) {
                            M = F.getResponseHeader(w) || i;
                            L = (N = I === "xml" || !I && M.indexOf("xml") >= 0) ? F.responseXML: F.responseText;
                            if (N && L.documentElement.nodeName === u) throw u;
                        }
                        if (a.isString(L)) if (I === m || !I && M.indexOf(m) >= 0) L = a.JSON.parse(L);
                        A = L
                    } catch(O) {
                        z = u
                    }
                    k([z === b ? b: j, f], A, z, B, p);
                    if (G === n) {
                        B.abort();
                        g(c, p)
                    }
                    if (p.async) B = null
                }
            };
            g(e, p);
            try {
                B.send(C === t ? p.data: null)
            } catch(J) {
                k([j, f], A, j, B, p)
            }
            p.async || g(f, p);
            return B
        }
    }
    function k(p, x, z, A, C) {
        if (a.isArray(p)) a.each(p,
        function(E) {
            k(E, x, z, A, C)
        });
        else {
            z === p && C[p] && C[p].call(C.context, x, z, A);
            g(p, C)
        }
    }
    function g(p, x) {
        s.fire(p, {
            ajaxConfig: x
        })
    }
    var l = window,
    h = function() {},
    d = "GET",
    t = "POST",
    w = "Content-Type",
    m = "json",
    q = m + "p",
    v = "script",
    i = "",
    o = "start",
    e = "send",
    c = "stop",
    b = "success",
    f = "complete",
    j = "error",
    n = "timeout",
    u = "parsererror",
    y = {
        type: d,
        url: i,
        contentType: "application/x-www-form-urlencoded",
        async: true,
        data: null,
        xhr: l.ActiveXObject ?
        function() {
            if (l.XmlHttpRequest) try {
                return new l.XMLHttpRequest
            } catch(p) {}
            try {
                return new l.ActiveXObject("Microsoft.XMLHTTP")
            } catch(x) {}
        }: function() {
            return new l.XMLHttpRequest
        },
        accepts: {
            xml: "application/xml, text/xml",
            html: "text/html",
            script: "text/javascript, application/javascript",
            json: "application/json, text/javascript",
            text: "text/plain",
            _default: "*/*"
        },
        jsonp: "callback"
    };
    a.mix(s, a.EventTarget);
    a.mix(s, {
        get: function(p, x, z, A, C) {
            if (a.isFunction(x)) {
                A = z;
                z = x
            }
            return s({
                type: C || d,
                url: p,
                data: x,
                success: function(E, D, B) {
                    z && z.call(this, E, D, B)
                },
                dataType: A
            })
        },
        post: function(p, x, z, A) {
            if (a.isFunction(x)) {
                A = z;
                z = x;
                x = r
            }
            return s.get(p, x, z, A, t)
        },
        jsonp: function(p, x, z) {
            if (a.isFunction(x)) {
                z = x;
                x = null
            }
            return s.get(p, x, z, q)
        }
    });
    s.getScript = a.getScript;
    a.io = a.ajax = s.ajax = s;
    a.jsonp = s.jsonp;
    a.IO = s
});
KISSY.add("anim-easing",
function(a) {
    var r = Math,
    s = r.PI,
    k = r.pow,
    g = r.sin,
    l = 1.70158,
    h = {
        easeNone: function(d) {
            return d
        },
        easeIn: function(d) {
            return d * d
        },
        easeOut: function(d) {
            return (2 - d) * d
        },
        easeBoth: function(d) {
            return (d *= 2) < 1 ? 0.5 * d * d: 0.5 * (1 - --d * (d - 2))
        },
        easeInStrong: function(d) {
            return d * d * d * d
        },
        easeOutStrong: function(d) {
            return 1 - --d * d * d * d
        },
        easeBothStrong: function(d) {
            return (d *= 2) < 1 ? 0.5 * d * d * d * d: 0.5 * (2 - (d -= 2) * d * d * d)
        },
        elasticIn: function(d) {
            if (d === 0 || d === 1) return d;
            return - (k(2, 10 * (d -= 1)) * g((d - 0.075) * 2 * s / 0.3))
        },
        elasticOut: function(d) {
            if (d === 0 || d === 1) return d;
            return k(2, -10 * d) * g((d - 0.075) * 2 * s / 0.3) + 1
        },
        elasticBoth: function(d) {
            if (d === 0 || (d *= 2) === 2) return d;
            if (d < 1) return - 0.5 * k(2, 10 * (d -= 1)) * g((d - 0.1125) * 2 * s / 0.45);
            return k(2, -10 * (d -= 1)) * g((d - 0.1125) * 2 * s / 0.45) * 0.5 + 1
        },
        backIn: function(d) {
            if (d === 1) d -= 0.0010;
            return d * d * ((l + 1) * d - l)
        },
        backOut: function(d) {
            return (d -= 1) * d * ((l + 1) * d + l) + 1
        },
        backBoth: function(d) {
            if ((d *= 2) < 1) return 0.5 * d * d * (((l *= 1.525) + 1) * d - l);
            return 0.5 * ((d -= 2) * d * (((l *= 1.525) + 1) * d + l) + 2)
        },
        bounceIn: function(d) {
            return 1 - h.bounceOut(1 - d)
        },
        bounceOut: function(d) {
            return d < 1 / 2.75 ? 7.5625 * d * d: d < 2 / 2.75 ? 7.5625 * (d -= 1.5 / 2.75) * d + 0.75 : d < 2.5 / 2.75 ? 7.5625 * (d -= 2.25 / 2.75) * d + 0.9375 : 7.5625 * (d -= 2.625 / 2.75) * d + 0.984375
        },
        bounceBoth: function(d) {
            if (d < 0.5) return h.bounceIn(d * 2) * 0.5;
            return h.bounceOut(d * 2 - 1) * 0.5 + 0.5
        }
    };
    h.NativeTimeFunction = {
        easeNone: "linear",
        ease: "ease",
        easeIn: "ease-in",
        easeOut: "ease-out",
        easeBoth: "ease-in-out",
        easeInStrong: "cubic-bezier(0.9, 0.0, 0.9, 0.5)",
        easeOutStrong: "cubic-bezier(0.1, 0.5, 0.1, 1.0)",
        easeBothStrong: "cubic-bezier(0.9, 0.0, 0.1, 1.0)"
    };
    a.Easing = h
});
KISSY.add("anim",
function(a, r) {
    function s(c, b, f, j, n, u) {
        if (c = a.get(c)) {
            if (! (this instanceof s)) return new s(c, b, f, j, n, u);
            var y = a.isPlainObject(f);
            b = b;
            this.domEl = c;
            if (a.isPlainObject(b)) b = a.param(b, ";").replace(/=/g, ":").replace(/%23/g, "#").replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
            var p = {},
            x = v.length,
            z;
            q.innerHTML = '<div style="' + b + '"></div>';
            for (c = q.firstChild.style; x--;) if (z = c[v[x]]) p[v[x]] = l(z);
            this.props = p;
            this.targetStyle = b;
            if (y) y = a.merge(e, f);
            else {
                y = a.clone(e);
                if (f) y.duration = m(f) || 1;
                if (a.isString(j) || a.isFunction(j)) y.easing = j;
                if (a.isFunction(n)) y.complete = n;
                if (u !== r) y.nativeSupport = u
            }
            this.config = y;
            if (y.nativeSupport && k() && a.isString(j = y.easing)) if (/cubic-bezier\([\s\d.,]+\)/.test(j) || (j = w.NativeTimeFunction[j])) {
                y.easing = j;
                this.transitionName = k()
            }
            a.isFunction(n) && this.on(o, n)
        }
    }
    function k() {
        var c = "transition",
        b;
        if (q.style[c] !== r) b = c;
        else a.each(["Webkit", "Moz", "O"],
        function(f) {
            if (q.style[c = f + "Transition"] !== r) {
                b = c;
                return false
            }
        });
        k = function() {
            return b
        };
        return b
    }
    function g(c, b, f) {
        a.UA.ie && f.indexOf(i) > -1 && t.css(c, i, b[i].v);
        c.style.cssText += ";" + f
    }
    function l(c) {
        var b = m(c);
        c = (c + "").replace(/^[-\d.]+/, "");
        return isNaN(b) ? {
            v: c,
            u: "",
            f: d
        }: {
            v: b,
            u: c,
            f: h
        }
    }
    function h(c, b, f) {
        return (c + (b - c) * f).toFixed(3)
    }
    function d(c, b, f) {
        for (var j = 2,
        n, u, y = [], p = []; n = 3, u = arguments[j - 1], j--;) if (u.substr(0, 4) === "rgb(") for (u = u.match(/\d+/g); n--;) y.push(~~u[n]);
        else if (u.substr(0, 1) === "#") {
            if (u.length === 4) u = "#" + u.substr(1, 1) + u.substr(1, 1) + u.substr(2, 1) + u.substr(2, 1) + u.substr(3, 1) + u.substr(3, 1);
            for (; n--;) y.push(parseInt(u.substr(1 + n * 2, 2), 16))
        } else return b;
        for (; n--;) {
            j = ~~ (y[n + 3] + (y[n] - y[n + 3]) * f);
            p.push(j < 0 ? 0 : j > 255 ? 255 : j)
        }
        return "rgb(" + p.join(",") + ")"
    }
    var t = a.DOM,
    w = a.Easing,
    m = parseFloat,
    q = t.create("<div>"),
    v = "backgroundColor borderBottomColor borderBottomWidth borderBottomStyle borderLeftColor borderLeftWidth borderLeftStyle borderRightColor borderRightWidth borderRightStyle borderSpacing borderTopColor borderTopWidth borderTopStyle bottom color font fontFamily fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex".split(" "),
    i = "opacity",
    o = "complete",
    e = {
        duration: 1,
        easing: "easeNone",
        nativeSupport: true
    };
    a.augment(s, a.EventTarget, {
        run: function() {
            var c = this,
            b = c.config,
            f = c.domEl,
            j, n, u, y, p = c.props,
            x = {},
            z;
            for (z in p) x[z] = l(t.css(f, z));
            if (c.fire("start") !== false) {
                c.stop();
                if (c.transitionName) c._nativeRun();
                else {
                    j = b.duration * 1E3;
                    u = a.now();
                    y = u + j;
                    n = b.easing;
                    if (a.isString(n)) n = w[n] || w.easeNone;
                    c.timer = a.later(b = function() {
                        var A = a.now(),
                        C = A > y ? 1 : (A - u) / j,
                        E,
                        D,
                        B;
                        for (z in p) {
                            E = x[z];
                            D = p[z];
                            if (D.v == 0) D.u = E.u;
                            if (E.u !== D.u) E.v = 0;
                            t.css(f, z, D.f(E.v, D.v, n(C)) + D.u)
                        }
                        if (c.fire("step") === false || (B = A > y)) {
                            c.stop();
                            B && c.fire(o)
                        }
                    },
                    13, true);
                    b()
                }
                return c
            }
        },
        _nativeRun: function() {
            var c = this,
            b = c.config,
            f = c.domEl,
            j = c.props,
            n = b.duration * 1E3;
            b = b.easing;
            var u = c.transitionName,
            y = {};
            y[u + "Property"] = "all";
            y[u + "Duration"] = n + "ms";
            y[u + "TimingFunction"] = b;
            t.css(f, y);
            a.later(function() {
                g(f, j, c.targetStyle)
            },
            0);
            a.later(function() {
                c.stop(true)
            },
            n)
        },
        stop: function(c) {
            if (this.transitionName) this._nativeStop(c);
            else {
                if (this.timer) {
                    this.timer.cancel();
                    this.timer = r
                }
                if (c) {
                    g(this.domEl, this.props, this.targetStyle);
                    this.fire(o)
                }
            }
            return this
        },
        _nativeStop: function(c) {
            var b = this.domEl,
            f = this.transitionName,
            j = this.props,
            n;
            if (c) {
                t.css(b, f + "Property", "none");
                this.fire(o)
            } else {
                for (n in j) t.css(b, n, t._getComputedStyle(b, n));
                t.css(b, f + "Property", "none")
            }
        }
    });
    s.supportTransition = function() {
        return !! k()
    };
    a.Anim = s
});
KISSY.add("anim-node-plugin",
function(a, r) {
    function s(i, o, e, c, b) {
        if (o === "toggle") {
            b = k.css(i, l) === h ? 1 : 0;
            o = "show"
        }
        if (b) k.css(i, l, k.data(i, l) || "");
        var f = {},
        j = {};
        a.each(v[o],
        function(n) {
            if (n === d) {
                f[d] = k.css(i, d);
                k.css(i, d, t)
            } else if (n === w) {
                f[w] = k.css(i, w);
                j.opacity = b ? 1 : 0;
                b && k.css(i, w, 0)
            } else if (n === m) {
                f[m] = k.css(i, m);
                j.height = b ? k.css(i, m) || i.naturalHeight: 0;
                b && k.css(i, m, 0)
            } else if (n === q) {
                f[q] = k.css(i, q);
                j.width = b ? k.css(i, q) || i.naturalWidth: 0;
                b && k.css(i, q, 0)
            }
        }); (new a.Anim(i, j, e, "easeOut",
        function() {
            if (!b) {
                var n = i.style,
                u = n[l];
                if (u !== h) {
                    u && k.data(i, l, u);
                    n[l] = h
                }
                f[m] && k.css(i, {
                    height: f[m]
                });
                f[q] && k.css(i, {
                    width: f[q]
                });
                f[w] && k.css(i, {
                    opacity: f[w]
                });
                f[d] && k.css(i, {
                    overflow: f[d]
                })
            }
            c && a.isFunction(c) && c()
        })).run()
    }
    var k = a.DOM,
    g = a.Anim,
    l = "display",
    h = "none",
    d = "overflow",
    t = "hidden",
    w = "opacity",
    m = "height",
    q = "width",
    v = {
        show: [d, w, m, q],
        fade: [w],
        slide: [d, m]
    };
    a.each([a.Node.prototype, a.NodeList.prototype],
    function(i) {
        i.animate = function() {
            var o = a.makeArray(arguments);
            a.each(this,
            function(e) {
                g.apply(r, [e].concat(o)).run()
            });
            return this
        };
        a.each({
            show: ["show", 1],
            hide: ["show", 0],
            toggle: ["toggle"],
            fadeIn: ["fade", 1],
            fadeOut: ["fade", 0],
            slideDown: ["slide", 1],
            slideUp: ["slide", 0]
        },
        function(o, e) {
            i[e] = function(c, b) {
                k[e] && arguments.length === 0 ? k[e](this) : a.each(this,
                function(f) {
                    s(f, o[0], c, b, o[1])
                });
                return this
            }
        })
    })
});
KISSY.add("cookie",
function(a) {
    var r = document,
    s = encodeURIComponent,
    k = decodeURIComponent;
    a.Cookie = {
        get: function(g) {
            var l;
            if (a.isString(g) && g !== "") if (g = r.cookie.match("(?:^| )" + g + "(?:(?:=([^;]*))|;|$)")) l = g[1] ? k(g[1]) : "";
            return l
        },
        set: function(g, l, h, d, t, w) {
            l = s(l);
            var m = h;
            if (typeof m === "number") {
                m = new Date;
                m.setTime(m.getTime() + h * 864E5)
            }
            if (m instanceof Date) l += "; expires=" + m.toUTCString();
            if (a.isString(d) && d !== "") l += "; domain=" + d;
            if (a.isString(t) && t !== "") l += "; path=" + t;
            if (w) l += "; secure";
            r.cookie = g + "=" + l
        },
        remove: function(g, l, h, d) {
            this.set(g, "", 0, l, h, d)
        }
    }
});
KISSY.add("attribute",
function(a, r) {
    function s() {
        this.__attrs = {};
        this.__attrVals = {}
    }
    function k(g) {
        g += "";
        return g.charAt(0).toUpperCase() + g.substring(1)
    }
    a.augment(s, {
        __getDefAttrs: function() {
            return a.clone(this.__attrs)
        },
        addAttr: function(g, l) {
            this.__attrs[g] = a.clone(l || {});
            return this
        },
        addAttrs: function(g, l) {
            var h = this;
            a.each(g,
            function(d, t) {
                if (t in l) d.value = l[t];
                h.addAttr(t, d)
            });
            return h
        },
        hasAttr: function(g) {
            return g && g in (this.__attrs || {})
        },
        removeAttr: function(g) {
            if (this.hasAttr(g)) {
                delete this.__attrs[g];
                delete this.__attrVals[g]
            }
            return this
        },
        set: function(g, l) {
            var h = this.get(g);
            if (h !== l) if (false !== this.__fireAttrChange("before", g, h, l)) {
                this.__set(g, l);
                this.__fireAttrChange("after", g, h, this.__attrVals[g]);
                return this
            }
        },
        __fireAttrChange: function(g, l, h, d) {
            return this.fire(g + k(l) + "Change", {
                attrName: l,
                prevVal: h,
                newVal: d
            })
        },
        __set: function(g, l) {
            var h, d = this.__attrs[g];
            if (d = d && d.setter) h = d.call(this, l);
            if (h !== r) l = h;
            this.__attrVals[g] = l
        },
        get: function(g) {
            var l;
            l = (l = this.__attrs[g]) && l.getter;
            g = g in this.__attrVals ? this.__attrVals[g] : this.__getDefAttrVal(g);
            if (l) g = l.call(this, g);
            return g
        },
        __getDefAttrVal: function(g) {
            g = this.__attrs[g];
            var l;
            if (g) {
                if (l = g.valueFn) {
                    l = l.call(this);
                    if (l !== r) g.value = l;
                    delete g.valueFn
                }
                return g.value
            }
        },
        reset: function(g) {
            if (this.hasAttr(g)) return this.set(g, this.__getDefAttrVal(g));
            for (g in this.__attrs) this.hasAttr(g) && this.reset(g);
            return this
        }
    });
    a.Attribute = s;
    s.__capitalFirst = k
});
KISSY.add("base",
function(a) {
    function r(s) {
        a.Attribute.call(this);
        for (var k = this.constructor; k;) {
            var g = k.ATTRS;
            if (g) {
                var l = void 0;
                for (l in g) g.hasOwnProperty(l) && !this.hasAttr(l) && this.addAttr(l, g[l])
            }
            k = k.superclass ? k.superclass.constructor: null
        }
        if (s) for (var h in s) s.hasOwnProperty(h) && this.__set(h, s[h])
    }
    a.augment(r, a.EventTarget, a.Attribute);
    a.Base = r
});
KISSY.add("core");
/*pub-1|2012-04-19 13:34:43*/
var TB = KISSY.app("TB");
TB.add("mod~global",
function() {
    var E = KISSY;
    TB.loginHttp = "https";
    TB._isLoginStatusReady = false;
    TB._loginStatusReadyFnList = [];
    TB._isMemberInfoReady = false;
    TB._memberInfoReadyFnList = [];
    TB.userInfo = {
        memberInfo: {}
    };
    TB.environment = {
        isTmall: window.location.hostname.indexOf("tmall.com") > -1 || window.location.hostname.indexOf("tmall.net") > -1,
        isDaily: window.location.hostname.indexOf("daily.taobao.net") > -1 || window.location.hostname.indexOf("daily.tmall.net") > -1 || window.location.hostname.indexOf("test.tmall.net") > -1,
        isHttps: window.location.href.indexOf("https://") === 0
    };
    var K = !"0" [0],
    R = K && !window.XMLHttpRequest,
    T = !!window.ActiveXObject;
    var D = window,
    h = document,
    j = h.domain,
    H;
    var C = j.indexOf("tmall.com") > -1,
    X = !(j.indexOf("taobao.com") > -1 || C),
    P = X ? ".daily.taobao.net": ".taobao.com";
    var L = X ? "assets.daily.taobao.net": "a.tbcdn.cn",
    Q = E.unparam(location.search.substring(1)),
    V = "g_config" in D ? ("appId" in D.g_config ? parseInt(D.g_config["appId"]) : undefined) : undefined;
    var Y = (h.location.href.indexOf("https://") === 0);
    var J = " ",
    N = "hover",
    g = "",
    A = "mini-cart",
    I = "mini-cart-no-layer";
    var d = {};
    var B = {
        siteNav: function() {
            if (!H) {
                return
            }
            H.setAttribute("role", "navigation");
            E.each(f("sn-menu", "*", H),
            function(i) {
                TB.Global._addMenu(i)
            });
            var S = f("cart", "li", H)[0];
            W(S, "click",
            function(k) {
                var i = k.target || k.srcElement;
                if (i.nodeName != "A" && i.parentNode.nodeName === "A") {
                    i = i.parentNode
                }
                if (i.nodeName === "A" && i.href.indexOf("my_cart.htm") > -1) {
                    G(k);
                    O(S, "hover");
                    TB.Cart && TB.Cart.redirect(i, i.href);
                    if (D.MiniCart) {
                        D.MiniCart._clicked = false
                    }
                }
            });
            TB.Global.memberInfoReady(function(k) {
                if (k.isLogin && k.memberInfo.mallSeller) {
                    var i = a("j_MyTaobao", H);
                    var l = a("j_SellerCenter", H);
                    M(i, "hidden");
                    O(l, "hidden")
                }
            })
        },
        tDog: function() {
            if ((V && V != -1) || "tstart" in Q || "tdog" in Q) {
                var S = "http://" + L + "/p/header/webww-min.js?t=20111206.js",
                i = 0;
                E.ready(function() {
                    if (E.DOM) {
                        E.getScript(S)
                    } else {
                        if (i < 10) {
                            setTimeout(arguments.callee, 1000);
                            i++
                        } else {
                            E.use("core",
                            function() {
                                E.getScript(S)
                            })
                        }
                    }
                })
            }
        },
        tLabs: function() {
            if (location.href.indexOf("tms.taobao.com") !== -1) {
                return
            }
            E.ready(function() {
                var i = "http://" + L + "/p/tlabs/1.0.0/tlabs-min.js?t=1.0.0.js",
                S = e("_nk_") || e("tracknick");
                S = encodeURIComponent(U(unescape(S.replace(/\\u/g, "%u"))));
                E.getScript(i,
                function() {
                    if (typeof TLabs !== "undefined") {
                        TLabs.init({
                            nick: S
                        })
                    }
                })
            })
        },
        POCMonitor: function() {
            var n = D._poc || [],
            m,
            k = 0,
            S = [["_setStartTime", (D.g_config || 0).startTime || D.HUBBLE_st || D.g_ks_monitor_st], ["_setAccount", (D.g_config || 0).appId]],
            l = 10000;
            while ((m = n[k++])) {
                if (m[0] === "_setRate") {
                    l = m[1]
                } else {
                    if (m[0] === "_setAccount") {
                        S[0] = m
                    } else {
                        if (m[0] === "_setStartTime") {
                            S[1] = m
                        } else {
                            S.push(m)
                        }
                    }
                }
            }
            if (S[0][1] && parseInt(Math.random() * l) === 0) {
                D._poc = S;
                E.getScript("http://a.tbcdn.cn/p/poc/m.js?0.0.1.js")
            }
        },
        initHeaderLinks: function() {
            if (!TB.environment.isDaily) {
                return
            }
            var k = H ? H.getElementsByTagName("a") : [];
            for (var S = 0; S < k.length; S++) {
                if (k[S].href.indexOf("register") === -1 && k[S].href.indexOf(".php")) {
                    k[S].href = k[S].href.replace("taobao.com", "daily.taobao.net").replace("tmall.com", "daily.tmall.net")
                }
            }
        },
        initLogout: function() {
            var S = h.getElementById("#J_Logout");
            if (!S) {
                return
            }
            W(S, "click",
            function(k) {
                k.halt();
                var i = S.href;
                new Image().src = "//taobao.alipay.com/user/logout.htm";
                setTimeout(function() {
                    location.href = i
                },
                20)
            })
        },
        test: function() {
            var S = false;
            var i = function() {
                if (S) {
                    return
                }
                S = true;
                if (location.href.indexOf("__cloudyrun__") > -1) {
                    E.getScript("http://assets.daily.taobao.net/p/cloudyrun/1.0/cloudyrun-taobao-pkg.js?t=" + ( + new Date()))
                }
            };
            E.ready(i);
            setTimeout(i, 4000)
        },
        assist: function() {
            if (e("test_accouts") && document.domain.indexOf("taobao.net") > -1) {
                E.ready(function() {
                    E.getScript("http://assets.daily.taobao.net/p/assist/login/login.js")
                })
            }
        },
        miniCart: function() {
            var S = TB.Global;
            if (S._OFF) {
                return
            }
            if (TB.environment.isApp && TB.environment.passCookie) {
                E.getScript("http://www" + P + "/go/app/tmall/login-api.php?t=" + E.now())
            }
        },
        mpp: function() {
            E.getScript("http://" + L + "/p/tstart/1.0/build/tb-mpp-min.js?t=201107210.js", {
                success: function() {
                    E.ready(function() {
                        if (!TB.Global.isLogin()) {
                            return
                        }
                        Mpp.Notify.register({
                            appId: 1010,
                            type: 1,
                            callback: function() {
                                E.getScript("http://" + (X ? "webww.daily.taobao.net:8080": "webwangwang.taobao.com") + "/getOtherSystem.do?callback=TB.Global.setUserMsg&t=" + E.now())
                            }
                        })
                    })
                }
            })
        }
    };
    var c = ["tDog", "tLabs", "test", "mpp"];
    for (var b = 0; b < c.length; b++) { (function(i) {
            var S = B[i];
            B[i] = function() {
                setTimeout(S, 1000)
            }
        })(c[b])
    }
    TB.Global = {
        init: function(S) {
            H = h.getElementById("site-nav");
            this._OFF = !!!H;
            this.config = S;
            if (S && S.mc && S.mc === -1) {
                this._OFF = true
            }
            if (window.top !== window.self) {
                this._OFF = true
            }
            this._subMenus = [];
            for (var i in B) {
                B[i]()
            }
        },
        writeLoginInfo: function(i) {
            H = h.getElementById("site-nav");
            if (!H) {
                return
            }
            var S = {
                isApp: false,
                passCookie: true,
                loginServer: "http://login.tmall.com",
                logoutServer: "http://login.taobao.com/member/logout.jhtml",
                registerServer: "http://register.tmall.com/",
                spaceServer: "http://jianghu.taobao.com/admin/home.htm",
                memberServer: "http://vip.tmall.com/member/index.htm"
            };
            i = E.merge(S, i);
            TB.environment.isApp = i.isApp;
            TB.environment.passCookie = i.passCookie;
            var k = TB.Global;
            k.loginStatusReady(function(v) {
                var r = i.loginServer;
                var n = window.location.href;
                if (/^http.*(\/member\/login\.jhtml)$/i.test(n)) {
                    n = ""
                }
                var l = i.redirectUrl || n;
                if (l) {
                    r += "?redirect_url=" + encodeURIComponent(l)
                }
                var u = i.spaceServer;
                var s = i.memberServer;
                var o = i.registerServer;
                var q = i.logoutServer + "?f=top&redirectURL=http://login.tmall.com/?redirect_url=" + encodeURIComponent("" + encodeURIComponent(l));
                if (TB.environment.isDaily) {
                    u = "http://jianghu.daily.taobao.net/admin/home.htm";
                    s = "http://vip.daily.tmall.net/member/index.htm";
                    o += "?isDaily=1";
                    q = "http://login.daily.taobao.net/member/logout.jhtml?f=top&redirectURL=http://login.daily.taobao.net/member/login.jhtml?redirect_url%3D" + encodeURIComponent("" + encodeURIComponent(l))
                }
                u += "?t=" + E.now();
                s += "?spm=2001.1.2.1";
                var m = document.getElementById("login-info");
                if (!m) {
                    return
                }
                var p = "";
                if (v.isLogin) {
                    p = '\u60a8\u597d\uff0c<a target="_top" href="' + u + '" class="j_UserNick sn-user-nick">' + v.nick + '</a>\uff01<a class="j_Identity sn-identity activated hidden" title="Tmall\u4eba" target="_top" href="' + s + '"></a><a class="j_Point sn-point hidden" target="_top" href="http://jifen.tmall.com/?spm=2001.1.1.1">\u79ef\u5206<span class="j_PointValue sn-point-value">0</span></a><span class="j_Message sn-message hidden"><a target="_top" href="http://vip.tmall.com/member/index.htm?layer=messagebox&amp;spm=2001.1.6.1" class="j_MessageText sn-msg-text">\u6d88\u606f</a><a target="_top" href="http://vip.tmall.com/member/index.htm?layer=messagebox&amp;spm=2001.1.6.1" class="j_MessageNum sn-msg-num">0</a><span class="sn-msg-box  j_MesssageBox hidden"><span class="sn-msg-hd"></span><span class="sn-msg-bd"><a href="#" class="j_MessageTitle sn-msg-title">\u52a0\u5165Tmall\u4ff1\u4e50\u90e8</a><b class="j_CloseMessage sn-msg-close">&times;</b></span></span></span><a class="sn-logout" target="_top" href="' + q + '" id="J_Logout">\u9000\u51fa</a>';
                    m.innerHTML = p;
                    if (R) {
                        var t = a("j_UserNick", H);
                        if (t.offsetWidth > 90) {
                            t.style.width = 90
                        }
                    }
                    k.memberInfoReady(function(AG) {
                        var AE = AG.memberInfo;
                        if (!AE || !AE.login) {
                            return
                        }
                        if (AE.activeStatus != -99) {
                            var AA = a("j_Identity", H);
                            if (AE.activeStatus >= 1) {
                                M(AA, "activated")
                            } else {
                                M(AA, "unactivated")
                            }
                            O(AA, "hidden")
                        }
                        if (AE.availablePoints != -99) {
                            var AF = a("j_PointValue", H);
                            AF.innerHTML = z(AE.availablePoints);
                            var AD = a("j_Point", H);
                            O(AD, "hidden")
                        }
                        if (AE.newMessage > 0 && AE.lastMessage && AE.lastMessageUrl) {
                            a("j_MessageText", H).href = AE.lastMessageUrl + "&spm=2001.1.6.1";
                            a("j_MessageNum", H).href = AE.lastMessageUrl + "&spm=2001.1.6.1"
                        }
                        if ((AE.newMessage || AE.newMessage == 0) && AE.newMessage != -99) {
                            var AB = a("j_MessageNum", H);
                            if (AE.newMessage <= 99) {
                                AB.innerHTML = AE.newMessage
                            } else {
                                AB.innerHTML = "99+"
                            }
                            var w = a("j_Message", H);
                            O(w, "hidden")
                        }
                        if (AE.newMessage > 0 && AE.messagePopup && AE.lastMessage) {
                            var y = a("j_MesssageBox", H);
                            var x = a("j_MessageTitle", H);
                            var AC = a("j_CloseMessage", H);
                            x.innerHTML = AE.lastMessage;
                            x.href = AE.lastMessageUrl;
                            W(AC, "click",
                            function(AI) {
                                var AH = "http://tmm.taobao.com/member/close_message_popup.do";
                                if (TB.environment.isDaily) {
                                    AH = "http://tmm.daily.taobao.net/member/close_message_popup.do"
                                }
                                AH += "?callback=_closeMessageCallback&t=" + E.now();
                                window._closeMessageCallback = function() {
                                    M(y, "hidden")
                                };
                                E.getScript(AH)
                            });
                            O(y, "hidden")
                        }
                        function z(AH) {
                            var AI = "";
                            if (AH >= 0 && AH < 10000) {
                                AI = AH
                            } else {
                                if (AH == 10000) {
                                    AI = "1\u4e07"
                                } else {
                                    if (AH < 100000) {
                                        AI = parseInt(AH / 1000) / 10 + "\u4e07";
                                        if (AH % 1000 > 0) {
                                            AI += "+"
                                        }
                                    } else {
                                        if (AH < 1000000) {
                                            AI = parseInt(AH / 10000) + "\u4e07";
                                            if (AH % 10000 > 0) {
                                                AI += "+"
                                            }
                                        } else {
                                            if (AH < 10000000) {
                                                AI = parseInt(AH / 1000000) + "\u767e\u4e07";
                                                if (AH % 1000000 > 0) {
                                                    AI += "+"
                                                }
                                            } else {
                                                if (AH < 100000000) {
                                                    AI = parseInt(AH / 10000000) + "\u5343\u4e07";
                                                    if (AH % 10000000 > 0) {
                                                        AI += "+"
                                                    }
                                                } else {
                                                    AI = parseInt(AH / 100000000) + "\u4ebf";
                                                    if (AH % 100000000 > 0) {
                                                        AI += "+"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            return AI
                        }
                    });
                    k._initMemberInfo()
                } else {
                    p = '\u4eb2\uff0c\u6b22\u8fce\u6765\u5929\u732b\uff01<a class="sn-login" href="' + r + '" target="_top">\u8bf7\u767b\u5f55</a><a class="sn-register" href="' + o + '" target="_top">\u514d\u8d39\u6ce8\u518c</a>';
                    m.innerHTML = p;
                    k._fireMemberInfoReadyFnList()
                }
            });
            k._initLoginStatus()
        },
        _initLoginStatus: function() {
            var i = TB.Global;
            if (TB.environment.isApp && TB.environment.passCookie) {
                TB.userInfo.nick = U(unescape(e("_nk_").replace(/\\u/g, "%u")));
                TB.userInfo.isLogin = (e("login") == "true" || !!e("_l_g_")) && TB.userInfo.nick;
                TB.userInfo.trackId = e("t");
                i._fireLoginStatusReadyFnList()
            } else {
                var S = "http://www.taobao.com/go/app/tmall/login-api.php";
                if (TB.environment.isDaily) {
                    S = "http://www.daily.taobao.net/go/app/tmall/login-api.php"
                }
                S += "?" + Math.random();
                E.getScript(S,
                function() {
                    TB.userInfo.nick = U(unescape((userCookie._nk_).replace(/\\u/g, "%u")));
                    TB.userInfo.isLogin = ( !! userCookie._l_g_) && TB.userInfo.nick;
                    TB.userInfo.trackId = userCookie.t;
                    i._fireLoginStatusReadyFnList()
                })
            }
        },
        loginStatusReady: function(S) {
            if (TB._isLoginStatusReady) {
                S.call(window, TB.userInfo)
            } else {
                if (TB._loginStatusReadyFnList) {
                    TB._loginStatusReadyFnList.push(S)
                }
            }
        },
        _fireLoginStatusReadyFnList: function() {
            if (TB._isLoginStatusReady) {
                return
            }
            TB._isLoginStatusReady = true;
            if (TB._loginStatusReadyFnList) {
                for (var S = 0; S < TB._loginStatusReadyFnList.length; S++) {
                    TB._loginStatusReadyFnList[S].call(window, TB.userInfo)
                }
            }
        },
        _initMemberInfo: function() {
            var S = TB.Global;
            var i = "http://tmm.taobao.com/member/query_member_top.do";
            if (TB.environment.isDaily) {
                i = "http://tmm.daily.taobao.net/member/query_member_top.do"
            }
            i += "?callback=_initMemberInfoCallback&t=" + E.now();
            window._initMemberInfoCallback = function(k) {
                TB.userInfo.memberInfo = k;
                S._fireMemberInfoReadyFnList()
            };
            E.getScript(i)
        },
        memberInfoReady: function(S) {
            if (TB._isMemberInfoReady) {
                S.call(window, TB.userInfo)
            } else {
                if (TB._memberInfoReadyFnList) {
                    TB._memberInfoReadyFnList.push(S)
                }
            }
        },
        _fireMemberInfoReadyFnList: function() {
            if (TB._isMemberInfoReady) {
                return
            }
            TB._isMemberInfoReady = true;
            if (TB._memberInfoReadyFnList) {
                for (var S = 0; S < TB._memberInfoReadyFnList.length; S++) {
                    TB._memberInfoReadyFnList[S].call(window, TB.userInfo)
                }
            }
        },
        _addMenu: function(l) {
            if (!l) {
                return
            }
            var i = this,
            n = f("menu-hd", "*", l)[0],
            m = f("menu-bd", "*", l)[0];
            if (!m || !n) {
                return
            }
            n.tabIndex = 0;
            i._subMenus.push(m);
            m.setAttribute("role", "menu");
            m.setAttribute("aria-hidden", "true");
            if (!m.getAttribute("id")) {
                m.setAttribute("id", E.guid("menu-"))
            }
            n.setAttribute("aria-haspopup", m.getAttribute("id"));
            n.setAttribute("aria-label", "\u53f3\u952e\u5f39\u51fa\u83dc\u5355\uff0ctab\u952e\u5bfc\u822a\uff0cesc\u5173\u95ed\u5f53\u524d\u83dc\u5355");
            var k = false;
            if (!Y && R) {
                k = h.createElement("iframe");
                k.src = "about: blank";
                k.className = "menu-bd";
                l.insertBefore(k, m)
            }
            W(l, "mouseover",
            function(p) {
                var o = p.relatedTarget;
                while (o && o !== l) {
                    o = o.parentNode
                }
                if (o !== l) {
                    E.each(i._subMenus,
                    function(q) {
                        if (q !== m) {
                            O(q.parentNode, N);
                            q.setAttribute("aria-hidden", "true")
                        }
                    });
                    M(l, N);
                    m.setAttribute("aria-hidden", "false");
                    if (!k) {
                        return
                    }
                    k.style.height = parseInt(m.offsetHeight) + 25 + "px";
                    k.style.width = parseInt(m.offsetWidth) + 1 + "px"
                }
            });
            W(l, "mouseout",
            function(p) {
                var o = p.relatedTarget;
                while (o && o !== l) {
                    o = o.parentNode
                }
                if (o !== l) {
                    O(l, N);
                    m.setAttribute("aria-hidden", "true");
                    E.each(m.getElementsByTagName("input"),
                    function(q) {
                        if (q.getAttribute("type") !== "hidden") {
                            q.blur()
                        }
                    })
                }
            });
            W(l, "keydown",
            function(p) {
                var o = p.keyCode;
                if (o == 27 || o == 37 || o == 38) {
                    O(l, N);
                    m.setAttribute("aria-hidden", "true");
                    n.focus();
                    G(p)
                } else {
                    if (o == 39 || o == 40) {
                        M(l, N);
                        m.setAttribute("aria-hidden", "false");
                        G(p)
                    }
                }
            });
            var S;
            W(l, T ? "focusin": "focus",
            function() {
                if (S) {
                    clearTimeout(S);
                    S = null
                }
            },
            !T);
            W(l, T ? "focusout": "blur",
            function() {
                S = setTimeout(function() {
                    O(l, N);
                    m.setAttribute("aria-hidden", "true")
                },
                100)
            },
            !T)
        },
        run: function() {
            var S = this;
            setTimeout(S.initMiniCart, 1000)
        },
        isLogin: function() {
            var i = e("tracknick"),
            S = e("_nk_") || i;
            return !! (e("_l_g_") && S || e("ck1") && i)
        },
        getCartElem: function() {
            return H && f("cart", "li", H)[0]
        },
        initMiniCart: function() {
            var i = this,
            n = "http://cart" + P + "/top_cart_quantity.htm?",
            l = function() {
                E.getScript(n + "callback=TB.Global.setCartNum&t=" + E.now() + (V ? "&appid=" + V: g))
            };
            if (i._OFF = (i._OFF || !!!TB.Global.getCartElem())) {
                return
            }
            var S = F(e("mt")),
            k,
            m;
            if (S && (k = S.ci)) {
                k = k.split("_");
                m = parseInt(k[1]);
                k = parseInt(k[0]);
                i._OFF = k < 0;
                if (k < 0) {
                    return
                }
                if (TB.Global.isLogin()) {
                    if (m === 0) {
                        l()
                    } else {
                        if (m === 1) {
                            TB.Global.setCartNum(k)
                        }
                    }
                } else {
                    if (m === 0) {
                        TB.Global.setCartNum(k)
                    } else {
                        if (m === 1) {
                            l()
                        }
                    }
                }
            } else {
                l()
            }
        },
        setCartNum: function(k) {
            if (!E.isNumber(k) || TB.Global._OFF) {
                return
            }
            var i = TB.Global.getCartElem();
            if (!i) {
                return
            }
            var l = i.getElementsByTagName("a")[0],
            m = '<span class="mini-cart-line"></span><s></s>\u8d2d\u7269\u8f66',
            S = V !== 19;
            if (k < 0) {
                TB.Global._OFF = k === -1;
                l.innerHTML = m;
                O(i, A);
                D.MiniCart && D.MiniCart.hide();
                return
            }
            l.innerHTML = m + '<span class="mc-count' + (k < 10 ? " mc-pt3": g) + '">' + k + "</span>\u4ef6" + (S ? "<b></b>": g);
            l.href = "http://ju.atpanel.com/?url=http://cart" + P + "/my_cart.htm?from=bmini&ad_id=&am_id=&cm_id=&pm_id=150042785330be233161";
            M(i, A);
            if (!S) {
                M(i, I)
            }
            M(i, "menu");
            M(l, "menu-hd");
            l.id = "mc-menu-hd";
            if (D.MiniCart) {
                D.MiniCart.cartNum = k;
                D.MiniCart.isExpired = true
            } else {
                E.ready(function() {
                    var n = 0;
                    E.getScript("http://" + L + "/p/global/1.0/minicart" + (X ? g: "-min") + ".js?t=20111215.js",
                    function() {
                        if (E.DOM) {
                            D.MiniCart.init(k, S)
                        } else {
                            if (n < 10) {
                                setTimeout(arguments.callee, 1000);
                                n++
                            } else {
                                E.use("core",
                                function() {
                                    D.MiniCart.init(k, S)
                                })
                            }
                        }
                    })
                })
            }
        },
        setUserMsg: function(l) {
            if (l.success && l.success === "true") {
                var k = E.DOM;
                if (!k) {
                    return
                }
                var n = k.get(".login-info", H),
                m = k.offset(n),
                i = k.get("#gb-msg-notice"),
                S;
                if (!i) {
                    i = k.create('<div id="gb-msg-notice"><div class="gb-msg-inner gb-msg-info"><p class="gb-msg-content">' + l.result["messages"][0] + '</p><div class="gb-msg-icon gb-msg-close" title="\u5173\u95ed"></div></div><div class="gb-msg-icon gb-msg-tri"><div class="gb-msg-icon gb-msg-tri-inner"></div></div></div>');
                    k.append(i, H.parentNode);
                    k.offset(i, {
                        left: m.left + 30,
                        top: m.top + k.height(n) + 1
                    });
                    E.Event.on(i, "click",
                    function(p) {
                        var o = p.target;
                        if (k.hasClass(o, "gb-msg-close")) {
                            k.hide(i)
                        }
                    })
                } else {
                    S = k.get(".gb-msg-content", i);
                    k.html(S, l.result["messages"][0]);
                    k.show(i)
                }
            }
        }
    };
    TB.Cart = E.merge({},
    {
        domain: (document.domain.indexOf("taobao.com") > -1 || document.domain.indexOf("tmall.com") > -1) ? "taobao.com": "daily.taobao.net",
        API: "http://cart.%domain%/check_cart_login.htm",
        cache: {},
        popup: null,
        redirect: function(m, l) {
            var k = E.makeArray(arguments);
            var n = arguments.callee;
            var S = this;
            if (!E.DOM || !E.Event) {
                E.getScript("http://a.tbcdn.cn/s/kissy/1.1.6/packages/core-min.js",
                function() {
                    n.apply(S, k)
                });
                return
            }
            this._addStyleSheetOnce();
            var i = E.guid();
            this.cache[i] = E.makeArray(arguments);
            E.getScript(this.API.replace("%domain%", this.domain) + "?callback=TB.Cart.redirectCallback&guid=" + i, {
                timeout: 4,
                error: function() {
                    location.href = l
                }
            })
        },
        redirectCallback: function(k) {
            var i = k.guid;
            var S = E.trim(this.cache[i][1]);
            if (!k.needLogin) {
                location.href = S;
                return
            }
            if (!i) {
                throw Error("[error] guid not found in callback data")
            }
            if (!this.popup) {
                this.popup = this._initPopup()
            }
            var l = "";
            if (k.ck && k.mk) {
                l = "ck=" + k.ck + "&mk=" + k.mk;
                S = S.replace("my_cart.htm?", "my_cart.htm?" + l + "&")
            }
            this._initLoginIframe(S)
        },
        hidePopup: function(S) {
            S && S.preventDefault && S.preventDefault();
            E.DOM.css(this.popup, "visibility", "hidden")
        },
        showPopup: function() {
            this._centerPopup();
            E.DOM.css(this.popup, "visibility", "visible")
        },
        _centerPopup: function() {
            var S = (E.DOM.viewportHeight() - parseInt(E.DOM.css(this.popup, "height"), 10)) / 2;
            S = S < 0 ? 0 : S;
            E.DOM.css(this.popup, "top", S)
        },
        _addStyleSheetOnce: function() {
            if (!this._stylesheetAdded) {
                E.DOM.addStyleSheet("#g-cartlogin{position:fixed;_position:absolute;border:1px solid #aaa;left:50%;top:120px;margin-left:-206px;width:412px;height:272px;z-index:10001;background:#fafafa;-moz-box-shadow:rgba(0,0,0,0.2) 3px 3px 3px;-webkit-box-shadow:3px 3px 3px rgba(0,0,0,0.2);filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=3,OffY=3,Color=#16000000,Positive=true);} #g_minicart_login_close{position:absolute;right:5px;top:5px;width:17px;height:17px;background:url(http://img01.taobaocdn.com/tps/i1/T1krl0Xk8zXXXXXXXX-194-382.png) no-repeat -100px -69px;text-indent:-999em;overflow:hidden;}#g-cartlogin-close{cursor:pointer;position:absolute;right:5px;top:5px;width:17px;height:17px;line-height:0;overflow:hidden;background:url(http://img03.taobaocdn.com/tps/i1/T1k.tYXadGXXXXXXXX-146-77.png) no-repeat -132px 0;text-indent:-999em;}");
                this._stylesheetAdded = true
            }
        },
        _initPopup: function() {
            var S = E.DOM.create('<div id="g-cartlogin"></div>');
            E.DOM.append(S, E.DOM.get("body"));
            return S
        },
        _initLoginIframe: function(S) {
            var i = "https://login." + this.domain + "/member/login.jhtml?from=globalcart&style=mini&redirectURL=" + encodeURIComponent(S) + "&full_redirect=true";
            this.popup.innerHTML = '<iframe src="' + i + '" width="410" height="270" frameborder="0" scrolling="0"></iframe><span title="\u5173\u95ed" id="g-cartlogin-close">\u5173\u95ed</span>';
            E.Event.on("#g-cartlogin-close", "click", this.hidePopup, this);
            this.showPopup()
        }
    });
    function e(i) {
        if (D.userCookie && !E.isUndefined(D.userCookie[i])) {
            return D.userCookie[i]
        }
        if (E.isUndefined(d[i])) {
            var S = h.cookie.match("(?:^|;)\\s*" + i + "=([^;]*)");
            d[i] = (S && S[1]) ? decodeURIComponent(S[1]) : g
        }
        return d[i]
    }
    function U(i) {
        var k = h.createElement("div"),
        S = h.createTextNode(i);
        k.appendChild(S);
        return k.innerHTML
    }
    function f(r, s, S) {
        var l = S.getElementsByTagName(s || "*"),
        p = [],
        n = 0,
        m = 0,
        o = l.length,
        k,
        q;
        r = J + r + J;
        for (; n < o; ++n) {
            k = l[n];
            q = k.className;
            if (q && (J + q + J).indexOf(r) > -1) {
                p[m++] = k
            }
        }
        return p
    }
    function a(S, i) {
        if (!i) {
            i = document
        }
        return f(S, "*", i)[0]
    }
    function W(l, k, i, S) {
        if (!l) {
            return
        }
        if (l.addEventListener) {
            l.addEventListener(k, i, !!S)
        } else {
            if (l.attachEvent) {
                l.attachEvent("on" + k, i)
            }
        }
    }
    function Z(l, k, i, S) {
        if (!l) {
            return
        }
        if (l.removeEventListener) {
            l.removeEventListener(k, i, !!S)
        } else {
            if (l.detachEvent) {
                l.detachEvent("on" + k, i)
            }
        }
    }
    function M(k, S) {
        var i = J + k.className + J;
        if (i.indexOf(J + S + J) === -1) {
            i += S;
            k.className = E.trim(i)
        }
    }
    function O(k, S) {
        var i = J + k.className + J;
        if (i.indexOf(J + S + J) !== -1) {
            i = i.replace(J + S + J, J);
            k.className = E.trim(i)
        }
    }
    function F(S) {
        if (D.userCookie && D.userCookie.version == "2") {
            return E.unparam(S, "&amp;")
        }
        return E.unparam(S)
    }
    function G(S) {
        if (S.preventDefault) {
            S.preventDefault()
        } else {
            S.returnValue = false
        }
    }
});
/*pub-1|2012-05-04 08:57:07*/
(function() {
    var H = this.JSTracker = {};
    H.version = "0.1";
    H.userpath = [];
    H._isTrack = true;
    H.config = {
        apiKey: "",
        url: "http://www.atpanel.com/ued.1.1.1?type=9&id=jstracker&v=" + H.version,
        rate: 300
    };
    H.notify = function(K, J, I) {
        if (!this.config.apiKey) {
            return
        }
        if (!this._isTrack) {
            return
        }
        F(A(K, J, I))
    };
    H.setConfig = function(I, J) {
        if (I in this.config) {
            this.config[I] = I === "rate" ? parseInt(J, 10) : J
        }
    };
    H._initConfigs = function() {
        var M = document.getElementsByTagName("script");
        var J = M[M.length - 1];
        for (var I in this.config) {
            var L = J.getAttribute("data-jstracker-" + I);
            L && this.setConfig(I, L)
        }
        var K = window.g_config;
        if (!this.config.apiKey && K && K.appId) {
            this.config.apiKey = K.appId
        }
    };
    H._format = B;
    H._buildUrl = A;
    H._initConfigs();
    var C = ~location.href.indexOf("__jstracker__");
    if (parseInt(Math.random() * H.config.rate) !== 0 && !C) {
        H._isTrack = false
    }
    this.onerror = function() {
        H.notify.apply(H, arguments)
    };
    var G = 0;
    function F(J) {
        if (G >= 5) {
            return
        }
        var I = window["jstracker-" + G++] = new Image();
        I.src = J
    }
    function A(N, L, I) {
        var K = [H.config.url];
        var M = {
            nick: D("_nk_") || D("tracknick"),
            islogin: E() ? 1 : 0,
            apikey: H.config.apiKey,
            msg: N,
            file: L || "",
            line: I || "",
            userpath: H.userpath.join("^"),
            scrolltop: (document.body || document.documentElement).scrollTop,
            screen: window.screen.width + "x" + window.screen.height,
            t: +new Date()
        };
        for (var J in M) {
            K.push(B("&%s=%s", J, encodeURIComponent(M[J])))
        }
        return K.join("")
    }
    function B(L) {
        var J = arguments;
        var K = 1;
        var I = J.length;
        return L.replace(/%[sdj%]/g,
        function(M) {
            if (K >= I) {
                return M
            }
            switch (M) {
            case "%%":
                return "%";
            case "%s":
                return String(J[K++]);
            default:
                return M
            }
        })
    }
    function D(J) {
        var I = document.cookie.match("(?:^|;)\\s*" + J + "=([^;]*)");
        return (I && I[1]) ? decodeURIComponent(I[1]) : ""
    }
    function E() {
        var J = D("tracknick"),
        I = D("_nk_") || J;
        return !! (D("_l_g_") && I || D("ck1") && J)
    }
})();